Hi I'm practicing some number theory and I've come across the following problem,
Suppose $n \geq 1$ is an odd integer that divides $a^2 - 1$ for some integer $a > 1$. Prove that,
$$n = \gcd(a-1, n)\gcd(a+1, n)$$
Now I know that the $\gcd(a-1, a+1) = 1$ if $a$ is even and $2$ if $a$ is odd and I believe this is relevant but I can't solve the problem. I've not really any idea where to start so even just help with that would be great.
Thanks