# Prove that $\sum_{k=1}^{p-1} k^i$ is divisible by $p$ [duplicate]

Let $$p$$ be an odd prime. Prove that $$1^i + 2^i + \cdots + (p-1)^i \equiv 0 \pmod{p}$$ for all $$i$$, $$1 \le i \le (p-2)$$.

If $$i$$ is odd, then we are done, since $$j^i + (p-j)^i \equiv 0 \pmod{p}$$ for every $$j$$. But how can we prove this if $$i$$ is even? Any ideas? Thanks for your help.

• math.stackexchange.com/questions/1777526/… – lab bhattacharjee Dec 25 '19 at 10:47
• Does this answer your question? $p$ divides $\sum\limits_{k=1}^{p-1} (k^p)^n$ or this – rtybase Dec 25 '19 at 11:49
• @rtybase Neither of these solve the problem. The answers of the first post aren’t all that great, and the answers of the second post solve only the case where $i$ is odd. – ViHdzP Dec 26 '19 at 0:19
• @URL I seriously insist you look at the links again. – rtybase Dec 26 '19 at 0:29
• @rtybase I correct myself: the answers in the second post solve only the even more trivial case $i=p$. – ViHdzP Dec 26 '19 at 0:31

## 1 Answer

Take $$\xi$$ a Primitive Root $$\text{mod }p$$. In particular, $$\xi^i\not\equiv1\pmod{p}$$. Therefore, $$1^i+2^i+\ldots+(p-1)^i\equiv\xi^0+\xi^i+\xi^{2i}+\ldots+\xi^{(p-2)i}\equiv\left(\xi^{(p-1)i}-1\right)\left(\xi^i-1\right)^{-1}\equiv0\pmod{p}.$$ $$\blacksquare$$