How many twin primes are of the form $2^n-1$ and $2^n+1$? The first pair is $(3,5)$ for $n=2$. Is there any other pair beside this?
 A: No, there are no more. A number of the form $2^n-1$ can only be prime if $n$ is prime (although there are prime $n$ which doesn't work, like $n = 11$, so $2^{11}-1$ is not prime), while a number of the form $2^n+1$ can only be prime if $n$ is a power of $2$ (again, there are power-of-two's which do not work, like $32$, so $2^{2^{5}} + 1$ is not prime). These two notions coincide only for $n = 2$.
Proofs:
Let $n$ be a composite number, say $n = pq$ for some $p, q\geq 2$. Then we have
$$
2^n-1 = 2^{pq}-1 = (2^p-1)(2^{(q-1)p} + 2^{(q-2)p} + \cdots + 2^p + 1)
$$
That this is composite follows from $p, q\geq 2$, which makes both of the above factors greater than $1$.
If $n$ is not a power of $2$, then $n = 2^mk$ where $k\geq 3$ is odd and $m\geq 0$. This gives us
$$
2^n + 1 = 2^{2^mk} + 1 = (2^{2^m} + 1)(2^{2^m(k-1)} - 2^{2^m(k-2)} + 2^{2^m(k-3)} - \cdots - 2^{2^m} + 1)
$$
which is necessarily composite, again because $k\geq 3$ so both factors are greater than $1$ ($k$ being odd is exactly what makes the signs work out so that you get $+1$ and not $-1$ at the end).
A: For Fermat primes, we need $n$ to be a power of $2$, for Mersenne primes, we need $n$ prime. The only possible common candidate occurs for $n=2$.
A: There is another proof that's similar to the proof that there are no prime triples other than $3,5,7:$
Note that one of $k,k+1,k+2$ is divisible by $3.$ Consider $k=2^n-1.$ Clearly $k+1$ is not divisible by $3$ since $k+1=2^n$ is a power of $2.$ So $2^n-1$ or $2^n+1$ must be divisible by $3.$
