Is $3$ the only prime that is both a Mersenne prime and a Fermat prime?

247 Views Asked by At

A Mersenne prime is a prime of the form $2^n-1$. A Fermat prime is a prime of the form $2^n+1$. Despite the two being superficially very similar, it is conjectured that there are infinitely many Mersenne primes but only finitely many Fermat primes.

Here is my inquiry:

QUESTION: Is $3$ the only prime that is both a Mersenne prime and a Fermat prime?

MY ATTEMPT

The prime $3$ is of the form $$3 = 2^2 - 1 = 2^{2^0} + 1$$ which shows that it is both a Mersenne prime and a Fermat prime.

However, I am having trouble proving that it is the only such prime.

Edited in response to an earlier closure of this question due to lack of context: (February 08, 2022 - 12:34 AM)

My main motivation for having asked this question was to check whether an odd perfect number could be divisible by some prime that is both a Mersenne prime and a Fermat prime. As the excellent answers so show, $3$ is the only such prime. However, (and this is the main caveat why I did not include this context earlier) it is currently unknown whether $3$, or whether any prime below $105$ for that matter, does divide an odd perfect number. To quote (or paraphrase, as I am currently unsure of the exact wording of) another mathematician's remark over at MathOverflow: "Such a result would be a major breakthrough in our understanding of odd perfect numbers."

2

There are 2 best solutions below

0
On

Regardless of primeness, Fermat-ness or Mersenne-ness, no natural number other than $3$ is simultaneously one larger than a power of two and also one smaller than a power of two (that requires two powers of two that are $2$ apart, and that only happens for $2^1$ and $2^2$).

$3$ also happens to be prime, and the relevant powers of $2$ happen to be such that $3$ is both Mersenne and Fermat.

0
On

This is a simple proof of the statement relied on in Arthur's answer: $$2^b-1=2^a+1 \Rightarrow 2^b-2^a=2 \Rightarrow 2^a(2^{b-a}-1)=2$$ Since $2$ is prime, we have the set of factors $\{2^a,(2^{b-a}-1)\}=\{2,1\}$, which has the unique solution $a=1,b=2$, from which $2^b-1=2^a+1=3$

As Arthur points out, this unique solution does not depend on $3$ being prime, or having any special form, although happily for OP's question, it is and does.