Mersenne Primes

An extension of the topic of primes and powers. Numbers of the form 2ᵖ−1 are sometimes prime (for prime p) — and it is among these that the record-breaking large known primes are found, thanks to a fast primality test. Marin Mersenne gave a list of them in 1644. The modern GIMPS project searches for ever larger ones (the largest, from 2024, has over 41 million digits).

Mersenne Primes
Mathematics · Number theory · Mersenne primes (1644)
Exponent pp in the number Mp=2p−1M_p = 2^p - 17
The largest known primes are most often numbers…
exponent p
7
2ᵖ − 1
127
is p prime?
yes
is 2ᵖ−1 prime?
PRIME
🎯 Challenge: is Mₚ prime?
streak: 0

I'll give you an exponent p — decide whether Mp=2p−1M_p = 2^p - 1 is prime. Note: a prime p does not guarantee a prime Mₚ.

What just happened?

Mersenne numbers are numbers of the form Mp=2p−1M_p = 2^p - 1. For some exponents pp this number is prime — we then call it a Mersenne prime:

Mp=2p−1M_p = 2^p - 1

Examples: 22−1=32^2-1=3, 23−1=72^3-1=7, 25−1=312^5-1=31, 27−1=1272^7-1=127 — all prime. But 211−1=2047=23⋅892^{11}-1 = 2047 = 23\cdot 89 is already composite, even though 11 is prime.

The key property (the invariant):

For 2p−12^p-1 to be prime, the exponent pp itself must be prime:

2p−1 prime  ⇒  p prime2^p - 1 \text{ prime} \;\Rightarrow\; p \text{ prime}

The implication works only one way. If p=a⋅bp = a\cdot b were composite, then 2a−12^a-1 would divide 2p−12^p-1 — so the number would not be prime. The converse need not hold, however: not every prime pp gives a Mersenne prime (counterexample: p=11p=11).

Where does the name come from, and why does it matter?

These numbers bear the name of the French monk and scholar Marin Mersenne, who in 1644 (“Cogitata Physico-Mathematica”) gave a list of exponents pp giving — as he believed — primes. His list contained a few errors, corrected only in the 20th century. Mersenne primes are closely tied to perfect numbers (the Euclid–Euler formula).

Why do the records belong to Mersenne?

For numbers of this form there is an exceptionally fast primality test — the Lucas–Lehmer test — working only for 2p−12^p-1. That is why the record-breaking large known primes are almost always Mersenne numbers. The GIMPS project (Great Internet Mersenne Prime Search, since 1996) uses the computing power of thousands of volunteers’ computers worldwide; the largest known prime (2024) has over 41 million digits.

Why this matters for your exam:

This is a model example that a necessary condition need not be sufficient: “pp prime” is necessary for 2p−12^p-1 to be prime, but does not guarantee primality. Telling an implication from an equivalence is a classic exam topic — and the primes are the foundation of modern cryptography.

Remember: Mp=2p−1M_p = 2^p-1; if 2p−12^p-1 is prime, then pp is too — but not the other way round. The largest known primes are Mersenne numbers, found today by the GIMPS project.

Illustrative model · NexTutor Virtual Laboratory

Enjoyed the experiment? Share it.

It's free — send it to friends from school.

Theory & formulas

Mersenne numbers

Mp=2 p−1M_p=2^{\,p}-1 They can be prime — but only when the exponent pp is prime (this is a necessary, not a sufficient, condition).

Counterexample

p=11p=11: M11=2047=23⋅89M_{11}=2047=23\cdot 89 — a composite number, even though 1111 is prime.

Records

The largest known primes are Mersenne numbers — thanks to the fast Lucas-Lehmer test. In 2024 the GIMPS project found a number with over 4141 million digits.

Notation: Mp=2p−1M_p=2^{p}-1 a Mersenne number, pp a prime exponent.

Frequently asked questions

›

What form do the largest known primes have?

Most often of the form 2ᵖ−1 — these are the Mersenne primes.

›

Does every prime p give a Mersenne prime?

No — e.g. p=11 gives 2¹¹−1=2047=23·89, a composite number. But if 2ᵖ−1 is prime, then p must be prime too.

›

What is the GIMPS project?

The Great Internet Mersenne Prime Search — a distributed search for ever larger Mersenne primes run on volunteers' computers.

Teaching? Embed this experiment on your site.

Free widget — paste it on your school site, blog or notes. It links to the full version.

Teaching a class or tutoring? Guide students in NexTutor →