3. Find all odd prime numbers $p$ such that
$$
p \mid \left(1^{p-1}+2^{p-1}+\cdots+2004^{p-1}\right) .
$$
First, prove:
$$
\begin{array}{l}
1^{p-1}+2^{p-1}+\cdots+2004^{p-1} \\
\equiv 2004-\left[\frac{2004}{p}\right](\bmod p),
\end{array}
$$

where $[x]$ denotes the greatest integer not exceeding the real number $x$.
Let $2004=k p+r(0 \leqslant r \leqslant p-1, k \in \mathbf{N})$. Then
$$
\begin{array}{l}
k \equiv r(\bmod p) \Rightarrow 2004=a p^{2}+p r+r \\
\Rightarrow p=2003 \text { or } 7 .
\end{array}
$$