If $e_1,e_2......,e_{p-1}$ denote primitive $p^{th}$ roots of unity. Here $p$ is prime. And set the sum of the $n^{th}$ powers of the $e_i$ as $p_n=e^n_1+e^n_2......+e^n_{p-1}$ Now I want to show that
(a) $p_n$ = -1 if $p\not| n$.
(b) $p_n$ = $p-1$ if $p|n$.
Thanks in advance.
If $p\nmid n$, then taking the $n$-th power is an automorphism of the (cyclic) group of $p$-th roots of unity. Therefore the summands $e_i^n$ in $p_n$ are just a permutation of the $e_i$, so this follows from the usual result that the sum of the primitive roots is $-1$.
If $p\mid n$, then $e_i^n=1$ for all $i$, so you're just summing up $p-1$ ones.