TITLE: not both $2^n-1,2^n+1$ can be prime.
QUESTION [21 upvotes]: I am trying to prove that not both integers $2^n-1,2^n+1$ can be prime for $n \not=2$. But I am not sure if my proof is correct or not:
Suppose both $2^n-1,2^n+1$ are prime, then $(2^n-1)(2^n+1)=4^n-1$ has precisely two prime factors. Now $4^n-1=(4-1)(4^{n-1}+4^{n-2}+ \cdots +1)=3A$. So one of $2^n-1, 2^n+1$ must be $3,$ which implies $n=1$ or $n=2$ (rejected by assumption). Putting $n=1$, we have $2^n-1=1,$ which is not a prime. Hence the result follows.
I also wanna know if there is alternative proof, thank you so much.

REPLY [3 votes]: If $n$ is even $=2m,2^n-1=2^{2m}-1=4^m-1$ is divisible by $4-1=3$ and $4^m-1>3$ if $m\ge1\iff n\ge2$
If $n$ is odd $=2m+1,2^n+1=2^{2m+1}+1$ is divisible by $2+1=3$ and $2^{2m+1}+1>3$ if $m\ge1\iff n\ge3$

alternatively,
$$(2^n-1)(2^n+1)=4^n-1$$ is divisible by $4-1=3$
So, at least one of $2^n-1,2^n+1$ is divisible by $3$
Now, $2^n+1>2^n-1>3$ for $n>2$
$\implies $ for $n>2,$ one of $2^n-1,2^n+1$ must be composite