# Prime numbers of form $a^n-1$. [duplicate]

Let $a$ and $n$ be integers greater than $1$. Suppose that $a^n - 1$ is prime. Show that $a=2$ and $n$ is prime.

• Hint for the first part: if $a^n - 1$ is prime, and $a^n > 3$, then what must the parity of $a^n - 1$ be? – David Kraemer Dec 4 '15 at 17:35
• This is a duplicate of the nth degree :-( I will pick a duplicate target if nobody else will. This has IMO some of the best answers. – Jyrki Lahtonen Dec 4 '15 at 18:09
• @JyrkiLahtonen I do not consider what you link to is as a duplicate. I voted to close as dupe of something which gives one pretty detailed argument. There might be better ones, but for this type of problem I would have a quite strong preference it's closed as dupe of the exact question, not something more general that is a bit harder to prove and does not even yield the desired thing directly. – quid Dec 4 '15 at 18:34
• @quid: Thanks for the suggestion. I did not think of my suggestion as an ideal target (in that case I would have closed this right away). You raise a fair point. I'm still somewhat stuck in that abstract duplicate thinking. It seems to me that is no longer a very popular viewpoint. So I sit on the sidelines. And observe and try to absorb how others feel about it. – Jyrki Lahtonen Dec 4 '15 at 18:47

Since $a^n-1=(a-1)(a^{n-1}+\dots+1)$ if $a>2$ then $a^n-1$ is divisible with $a-1$. $a^n-1$is prime, so $a$ should be 2.

If $n=p\times q$ then $2^n-1= (2^p)^q-1=(2^p-1)((2^p)^{q-1}+\dots+1)$ and $2^n-1$ will divisible with $2^p-1$. $2^n-1$ is prime so $n$ wouldn't be written as $p\times q$, so $n$ is prime.

Hint:

$a^n-1=(a-1)(1+\dots+a^{n-1})$

• Pretty incomplete even as a hint. At least you should use different letters. Then one might say one applies it twice. – quid Dec 4 '15 at 17:49
• @quid why different letters? To me this looks like almost a complete answer. – lisyarus Dec 4 '15 at 17:50
• @lisyarus how does it show that $n$ is prime? – quid Dec 4 '15 at 17:50
• @quid my mistake, now I agree with you. – lisyarus Dec 4 '15 at 17:53
• @quid I agree with you too. Fortunately Hoseyn gave a more complete answer and took over the acceptance. – drhab Dec 4 '15 at 17:56