# Problem modulo $p$.

Let $p$ be a odd prime, prove that $1^p+2^p+...+(p-1)^p \equiv 0 \mod p$

I'm not sure how to do this, thanks.

-

Hint:

Fermat's Little Theorem says that $a^p\equiv a\pmod{p}$.

The formula for $1+2+3+\dots+(n-1)=\frac{n(n-1)}{2}$

-
I am not quite seeing how Fermat's little theorem will help me, I need it congruent to 0, not a. –  user142903 Apr 13 at 21:42
@user142903: apply FLT to each term in your sum, then apply the sum formula. –  robjohn Apr 13 at 21:48

Divide the numbers from $1$ to $p-1$ into couples, where $x$ is coupled with $p-x$. Note that $x^p +(p-x)^p\equiv 0\pmod{p}$. For $(p-x)^n\equiv (-x)^p \equiv -x^p\pmod{p}$, So the sum of the $p$-th powers of any couple is congruent to $0$, and therefore our whole sum is congruent to $0$.

Remark: Exactly the same argument shows that if $n$ is any odd positive integer, then $1^n+2^n+\cdots+(p-1)^n\equiv 0\pmod{p}$.

-

Hint: use Fermat's little theorem for p>2, that is $x^p\equiv x \bmod{p}$

-

Fermat's Little Theorem gives us that if $gcd(a, p) = 1$, then $a^{p} \equiv a \pmod{p}$.

So $\sum_{i=1}^{p-1} i^{p} \equiv \sum_{i=1}^{p} \pmod{p}$. If $p$ is odd, we have $\sum_{i=1}^{p-1} i = \frac{p-1}{2} * p$. In which case, we have $p| p * \frac{p-1}{2}$. Since $p-1$ is even, $\frac{p-1}{2}$ is an integer.

-