Prove: If $p$ is prime and $ (a,p)=1 $, then $\ 1 + a + a^2 + ... + a^{p-2}=0$(mod $p$) Prove: If $p$ is prime and $ (a,p)=1 $, then $\ 1 + a + a^2 + ... + a^{p-2}≡0 \pmod p$
As an example, for $a=2$ and $p=5$, then:
$$1+2+2^2+2^3=1+2+4+8=15≡0 \pmod 5$$
This can also be written as:
$$1 \pmod 5 + 2 \pmod 5 + 4 \pmod 5 + 3 \pmod 5 ≡ 10 \pmod 5 ≡ 0 \pmod 5$$
Which is a complete residue system (mod 5). This is where I'm stuck. At a glance it looks like fermat's little theorem, but it seems like I have to prove this creates a CRS for any $a$ and any $p$. How can I proceed? Thanks!

If $p=2$, then $a^{p-2}=a^0=1$, so in this case is false, because $1\not\equiv 0(mod \ 2)$.
If $p\neq 2$, then $1+a+\dots+ a^{p-2}=\frac{a^{p-1}-1}{a-1}$. From the fermat theorem, if $(a,p)=1$, then $a^{p-1}\equiv 1 (mod\ p)$ (if this doesn't happen, maybe the $p$ factor of $a^{p-1}-1$ will dissapear), so you need now to see that $p\not\mid a-1$, because if not, for example if $p=7$ and $a=8$, you will have 
$$1+8+\dots+8^5\equiv 6\not\equiv 0 (mod\ 7)$$
If $p\neq 2$ and $(a(a-1),p)=1$, then it's true.
