Sum of powers mod p

2.2k Views Asked by At

I've this problem that I did halve of the proof but I can't do the rest of it.

Let $p$ be an odd prime. We define $S_n$ as $S_n = 1^n +2^n + ... +(p-1)^n$
Prove that $S_n \equiv \begin{cases} 0 & \text{if $p-1 \nmid n $ } \\ -1, & \text{if $p-1 \mid n$ } \end{cases}$

Partial proof:

If $p-1\mid n$, then $\varphi(n)=p-1=kn$ for some k. As $p$ is prime, then every number from 1 to $p-1$ is relatively prime to it. So, using the Fermat-Euler Theroem, $a^{\varphi(n)} \equiv 1$ if $1 \leq a \leq p-1$. We see that every term in the sum becomes congruent to 1, and $\sum_1^{p-1} 1 = p-1 \equiv -1 \pmod p $.

I don't know what to do if $p-1 \nmid n $. I've tried taking a primitive root mod p, but I got stuck.Any help or tip would be much aprecciated.

2

There are 2 best solutions below

1
On BEST ANSWER

To elaborate on my comment:

Suppose that $p-1\nmid n$. Then let $g$ be a primitive root $\pmod p$. It follows that $g^n\not \equiv 1 \pmod p$. Also, $g$ is clearly invertible $\pmod p$. That implies that the list $\{g\times 1, g\times 2, \cdots, g\times (p-1)\}$ is a full list of the non-zero residues $\pmod p$.

Thus $$S_n\equiv (g\times 1)^n+(g\times 2)^n+\cdots +(g\times (p-1))^n\equiv g^nS_n \pmod p$$

But then, as $g^n\not \equiv 1$ we see that $S_n\equiv 0\pmod p$ as desired.

1
On

Let $g$ be a primitive root mod $p$. Then $$ \begin{align} 1^n +2^n + \cdots +(p-1)^n &= (g^0)^n + (g^1)^n + \cdots + (g^{p-2})^n \\&= (g^n)^0 + (g^n)^1 + \cdots + (g^n)^{p-2} \\&= \frac{(g^n)^{p-1}-1}{g^n-1} \\&= 0 \end{align} $$ if $g^n\ne 1$, that is, if $p-1 \not \mid n$.