Show the following if $p$ is prime If $p$ is prime and $ a \ge 2$, prove that 
$$
d = (a - 1, \frac{a^p - 1}{a - 1}) =
\begin{cases}
p & \text{if } p \mid (a - 1)\\
1 & \text{if } p \nmid (a - 1) \, .
\end{cases}
$$
I was thinking that since $(a^p-1)/(a-1) = (a^{p-1}+a^{p-2}+...+1)$ if p divides a-1 then p should divide $(a^{p-1}+a^{p-2}+...+1)$ ??

We find the remainder when the polynomial $f(x)=x^{p-1}+x^{p-2}+\cdots+1$ is divided by $x-1$. This is $f(1)$, which is $p$.
So the gcd of $a-1$ and $f(a)$ is the same as the gcd of $a-1$ and $p$, and we are finished.
