I have a homework for the university and I am 'on this' for the entire week, so I really need help.
The question:
let $p>2$ be a prime number and $n\in \Bbb N$, $\ p-1\nmid n$.
Prove that $1^n+2^n+...+(p-1)^n \equiv 0\pmod p$.
I thought:
- it is pretty clear that $p-1$ is composite so I can write $p-1=q_1^{t_1}q_2^{t_2}...q_k^{t_k}=\prod_{i=0}^{k} q_i^{t_i}$ and I know that $2 \le q_i\le p-1 \ , \ \ 0 \le i \le k \ $ and that $ \ 2\mid p-1$ so $ \ p-1=2k$.
- The sum is $\sum_{i=0}^{p-1} i^n=1^n+2^n+...+(p-1)^n \equiv 0\pmod p$ but I don't know what can I understand from that.
I really need help.
Thank you
Consider a primitive root $g \bmod{p}$. We have: $$1^n+2^n+\ldots+(p-1)^n \equiv 1+g^n+g^{2n}+\ldots+g^{(p-2)n}=\frac{g^{(p-1)n}-1}{g^n-1} \pmod{p}$$
As $p-1 \nmid n$, we have $p \nmid (g^n-1)$. As $p-1 \mid (p-1)n$, we have $p \mid (g^{(p-1)n}-1)$. That shows that: $$p \mid \frac{g^{(p-1)n}-1}{g^n-1} \implies p \mid (1^n+2^n+\ldots+(p-1)^n)$$