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!

Notice that Fermat's Little Theorem tells us that if $p$ is prime and $\gcd(a,p)=1$, then
$$a^{p-1} \equiv 1 \bmod p$$
Clearly $a^{p-1}-1 \equiv 0 \bmod p$. Recall that $x^n-1 = (x-1)(1 + x + x^2 + \cdots + x^{n-1})$, and so
$$a^{p-1}-1 = (a-1)(1+a+a^2 + \cdots + a^{p-2})$$
We know that $a^{p-1}-1 \equiv 0 \bmod p$, i.e. $p$ divides $a^{p-1}-1$. Since $p$ is prime, it follows that either $p$ divides $a-1$ or that $p$ divides $1+a+a^2 + \cdots + a^{p-2}$.
In summary: if $\gcd(a,p)=\gcd(a-1,p)=1$ then $p$ will divide $1+a+a^2 + \cdots + a^{p-2}$.
