Solution:
Note that kp−1≡0(modp) if p divides k and kp−1≡1(modp) otherwise (by Fermat's little theorem). Then
0≡1p−1+2p−1+⋯+2004p−1≡0⋅[p2004]+1⋅(2004−[p2004])(modp)
which implies
2004≡[p2004](modp)
(in particular, p<2004). Let 2004=qp+r, where 0≤r≤p−1. Then [p2004]=[q+pr]=q and (1) is equivalent to r≡q(modp).
For q<p, this congruence gives r=q. Then
2004=(p+1)q≤p2−1
and therefore p≥47. Since p+1 divides 2004=3⋅4⋅167, we get p=2003 which is a solution of the problem.
For q≥p, we have that 2004≥pq≥p2, i.e., p≤43. A direct verification of (1) shows that p=17 is the only solution in this case.