# Thread: need help solving this problem

1. ## need help solving this problem

show that 1^p+2^p+3^p+...+(p-1)^p is congruent to 0 (mod p) when p is an odd prime

2. Hello,

It can be proved for any odd integer...

Separate the sum in two parts :

$S_1=1^p+2^p+\dots+\left(\frac{p-1}{2}\right)^p$

$S_2=\left(\frac{p+1}{2}\right)^p+\left(\frac{p+1}{ 2}+1\right)^p+\dots+(p-1)^p$

In each sum, there are $\frac{p-1}{2}$ terms.

And in the second one, just notice that :

\begin{aligned}S_2 &=\left(p-\tfrac{p-1}{2}\right)^p+\left(p-\left(\tfrac{p-1}{2}-1\right)\right)^p+\dots+(p-2)^p+(p-1)^p \\

3. Or a bit more simply (no offense Moo ) note that

$a^p \equiv a \mod p$

by Fermat's little theorem. Hence

$1^p+...+(p-1)^p \equiv 1+...+(p-1) = p(p-1)/2 \equiv 0 \mod p$

4. Originally Posted by Bruno J.
Or a bit more simply (no offense Moo ) note that

$a^p \equiv a \mod p$

by Fermat's little theorem. Hence

$1^p+...+(p-1)^p \equiv 1+...+(p-1) = p(p-1)/2 \equiv 0 \mod p$
No offence

It's just that I've taken the proof from the case p is an odd integer, not necessarily a prime number

Well, surely yours is easier and better for this case