Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question


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}$

share|cite|improve this answer
I am not quite seeing how Fermat's little theorem will help me, I need it congruent to 0, not a. – user142903 Apr 13 '14 at 21:42
@user142903: apply FLT to each term in your sum, then apply the sum formula. – robjohn Apr 13 '14 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}$.

share|cite|improve this answer

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

share|cite|improve this answer

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.