Sum equals zero

52 Views Asked by At

I have the following question. Let $p \geq 3$ be a prime, $n \in \mathbb{N}$. I want to show, that $$\sum_{k=1}^{p-1} k^n \equiv \begin{cases} -1 \mod p, & \text{if } n \equiv 0 \pmod{p-1} \\ 0 \mod p, & \text{else.} \end{cases}$$ I figured out the first case using Fermat’s little theorem and the second case, but only for odd $n$ since then the first and last $(p-1)/2$ terms cancel out. Does anyone have a hint how to see the result in general. Thank in advance.