# 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 :

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

$\displaystyle 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 $\displaystyle \frac{p-1}{2}$ terms.

And in the second one, just notice that :

\displaystyle \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 \\ &\equiv \left(-\tfrac{p-1}{2}\right)^p+\left(-\left(\tfrac{p-1}{2}-1\right)\right)^p+\dots+(-2)^p+(-1)^p \quad(\bmod p) \\ &\equiv -\left(\tfrac{p-1}{2}\right)^p-\dots-2^p-1^p \quad(\bmod p) \quad (\text{p is odd})\\ &\equiv -S_1 \quad(\bmod p) \quad \quad \blacksquare \end{aligned}

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

$\displaystyle a^p \equiv a \mod p$

by Fermat's little theorem. Hence

$\displaystyle 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

$\displaystyle a^p \equiv a \mod p$

by Fermat's little theorem. Hence

$\displaystyle 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