7. Let $[x]$ denote the greatest integer not exceeding the real number $x$. Find the number of elements in the set $\left\{n \left\lvert\, n=\left[\frac{k^{2}}{2005}\right]\right., 1 \leqslant k \leqslant 2004, k \in \mathbf{N}\right\}$.
7. From $\frac{(k+1)^{2}}{2005}-\frac{k^{2}}{2005}=\frac{2 k+1}{2005} \leqslant 1$, we solve to get $k \leqslant 1002$. That is, when $k=1,2, \cdots, 1002$, $\left[\frac{(k+1)^{2}}{2005}\right]=\left[\frac{k^{2}}{2005}\right]$ or $\left[\frac{(k+1)^{2}}{2005}\right]=\left[\frac{k^{2}}{2005}\right]+1 \cdot\left[\frac{1002^{2}}{2005}\right]=500,\left[\frac{1^{2}}{2005}\right]=0$, hence when $k=1,2, \cdots, 1002$, $\left[\frac{k^{2}}{2005}\right]$ can take all values $0,1, \cdots, 500$.

Additionally, when $k=1003,1004, \cdots, 2004$, since $\frac{(k+1)^{2}}{2005}-\frac{k^{2}}{2005}>1$, thus $\left[\frac{(k+1)^{2}}{2005}\right] \geqslant\left[\frac{k^{2}}{2005}\right]+1$, meaning $\left[\frac{1003^{2}}{2005}\right],\left[\frac{1004^{2}}{2005}\right], \cdots,\left[\frac{2004^{2}}{2005}\right]$ are all distinct. These numbers total $2004-1002=1002$. Noting that $\left[\frac{1003^{2}}{2005}\right]=501>\left[\frac{1002^{2}}{2005}\right]$, we know the set has a total of $501+1002=1503$ elements.