Possible Duplicate:
Using Fermat’s Little Theorem Prove if $p$ is prime, prove $1^p + 2^p + 3^p +…+(p-1)^p \equiv 0 \bmod{p}$
If p is an odd prime, prove: (Using Fermat's Theorem, both versions)
a)$1^p + 2^p + 3^p +\cdots+(p-1)^p$ is congruent to $0\pmod p$
b) $1^{p-1} + 2^{p-1} + \cdots+(p-1)^{p-1}$ is congruent to $-1\pmod p$
I know both verisons are:
$q^p =q\pmod p$ and $q^{p-1}=1 \pmod p$