Let $p$ be a prime. Compute $1^k + 2^k + \ldots + (p-1)^k \pmod{p}$.

265 Views Asked by At

An exercise at the end of a chapter on primitive roots asked me to compute $1^k + 2^k + \ldots + (p-1)^k \pmod{p}$ for any positive integer $k$ and any prime $p$. Clearly, if $k$ is odd, the expression is congruent to $0$ modulo $p$. But how can I even approach this problem if $k$ is even? And how do primitive roots apply? Hints would be greatly appreciated.

1

There are 1 best solutions below

2
On

apply Fermat's little theorem it says

$a^p \equiv \pmod p$

If $p-1 \mid k$ then by Fermat Little Theorem $a^k \equiv 1 \pmod p$