I'm currently tackling a few problems about divisibility and gcd, and I'm stumped by a few things. The arguments aren't that long for most of them so I'll write them in a list-type structure.
1: Let $a$ and $n$ be positive integers with $n \neq 1$. Prove that, if $a^n -1$ is a prime number, then $a=2$ and $n$ is a prime number.
Using the factorization $x^n - y^n = (x-y) \sum_{i=1}^n x^{n-i}y^{i-1}$, we see that, choosing $x=a$ and $y=1$ that, in order for the number not to be composite, $x$ must equal $2$. But why must $n$ be a prime number for $a^n-1$ to be prime?
2: Let $a$ and $n$ be positive integers with $a > 1$. Prove that, if $a^n+1$ is a prime number, then $a$ is even and $n$ is a power of $2$.
Suppose $a$ is odd, then $a^n$ is odd and $a^n+1$ is even and hence not a prime. But why must $n$ be a power of $2$?
Thanks! I hope you can help.