HomeScience GlossaryMersenne Primes: The Largest Primes Ever Found

Mersenne Primes: The Largest Primes Ever Found

A Mersenne prime is a prime number of the form 2^n - 1, where n is itself prime. Only 52 are known. Learn how the Lucas-Lehmer test works and why GIMPS keeps finding record-breaking primes.

Share
Science Glossary · Explore this series
April 4, 2026
Key Takeaways
  • Mersenne primes take the form 2^n - 1 where n is prime.
  • Only 52 Mersenne primes have been found in over 2,300 years.
  • The Lucas-Lehmer test makes them far easier to verify than other large primes.

A Mersenne prime is a prime number that takes the form 2n - 1, where n is itself prime. Only 52 are known, and whether infinitely many exist remains one of the oldest open questions in mathematics.

Why it matters

Key figure

52

Mersenne primes found in over 2,300 years of searching

Mersenne primes sit at the intersection of ancient number theory, modern computing, and the unsolved structure of the integers. They are the largest primes ever found, not because they are the most common, but because mathematicians have an unusually efficient way to test them.

That efficiency has practical consequences. For a general number with millions of digits, proving primality could take longer than the age of the universe. For a number of the form 2n - 1, the Lucas-Lehmer test delivers a definitive answer in time proportional to n2. This is why the record for the largest known prime has been held by a Mersenne prime almost continuously since 1952.

Every even perfect number (a number equal to the sum of its proper divisors, like 6 = 1 + 2 + 3, or 28 = 1 + 2 + 4 + 7 + 14) corresponds to exactly one Mersenne prime. Euclid proved one direction of this link around 300 BC. Leonhard Euler completed the proof in 1747. If infinitely many Mersenne primes exist, infinitely many perfect numbers exist. If not, there is a largest perfect number somewhere in the integers. Nobody knows which is true.

The Mersenne Twister, the default random number generator in Python, C++, Ruby, R, and MATLAB, takes its name from these primes. Mathematicians Makoto Matsumoto and Takuji Nishimura designed the algorithm in 1997 with a period of 219937 - 1, itself a Mersenne prime. They chose that number because its mathematical properties guarantee an unusually even distribution of outputs.

How the Lucas-Lehmer test works

The formula is simple. Start with a prime number n. Compute 2n - 1. If the result is also prime, it is a Mersenne prime.

The first few work: n = 2 gives 3, n = 3 gives 7, n = 5 gives 31, n = 7 gives 127. All prime. But n = 11 gives 2,047, which factors as 23 times 89. No pattern predicts which exponents will produce primes.

Key figure

41 million

Digits in the largest known Mersenne prime, confirmed October 2024

Testing relies on the Lucas-Lehmer test, developed by French mathematician Edouard Lucas in the 1870s and refined by Derrick Henry Lehmer in the 1930s. The method works by computing a sequence: start with 4, then repeatedly square and subtract 2, taking the remainder modulo 2n - 1 at each step. After n - 2 iterations, if the result is zero, the number is prime. No factoring required, no trial division, no probabilistic guessing. It is a definitive yes-or-no answer.

Lucas used this method by hand to prove that 2127 - 1 is prime, a 39-digit number and the largest prime verified without electronic computers. That record stood from 1876 until the digital era.

The search for new Mersenne primes

Since 1996, the Great Internet Mersenne Prime Search (GIMPS) has coordinated volunteers to run Lucas-Lehmer tests on their home computers. A central server assigns exponent ranges to participants, each machine tests its candidates, and results are verified independently before a discovery is announced.

GIMPS has found 18 Mersenne primes. The most recent, 2136,279,841 - 1, was confirmed in October 2024 by Luke Durant, a former NVIDIA engineer who ran the search across a network of cloud GPU servers spanning 17 countries. The number has 41,024,320 digits. Writing it out in 12-point type would fill roughly 15,000 pages.

The gap between consecutive discoveries follows no pattern. The previous record before Durant's discovery had stood since 2018. Other gaps have been as short as a few months. GIMPS also serves as an unintentional stress test for hardware: the Lucas-Lehmer computation is so demanding that Prime95, the software volunteers run, is widely used to test overclocked CPUs.

Key context

Marin Mersenne, the 17th-century French friar who gave these primes their name, was as much a scientific networker as a mathematician. He corresponded with Descartes, Fermat, Pascal, and Galileo, serving as a human switchboard for European scientific thought before journals existed. In 1644, he published a list of exponents he believed would produce primes of the form 2n - 1. He got five wrong. His name stuck anyway because nobody did better for two centuries.

The Lenstra-Pomerance-Wagstaff conjecture predicts that the number of Mersenne primes with exponent below N grows proportionally to log N. By this estimate, roughly 65 Mersenne primes should have exponents below one billion. The count stands at 52. The conjecture fits the data, but remains unproven.

FAQ

What is the difference between a Mersenne number and a Mersenne prime?

A Mersenne number is any number of the form 2^n - 1. A Mersenne prime is a Mersenne number that also happens to be prime. Most Mersenne numbers are not prime. For example, 2^11 - 1 = 2,047 is a Mersenne number but not a Mersenne prime because it factors as 23 times 89.

Why are the largest known primes almost always Mersenne primes?

Mersenne primes are not more common than other primes. They are simply easier to test. The Lucas-Lehmer test can verify a Mersenne candidate with millions of digits far faster than any general-purpose primality test. This efficiency is why the largest known prime has been a Mersenne prime almost continuously since 1952.

How many Mersenne primes are there?

As of October 2024, 52 Mersenne primes have been found. Whether infinitely many exist is an open question. The Lenstra-Pomerance-Wagstaff conjecture predicts there should be roughly 65 with exponents below one billion, but this remains unproven.

Can anyone help search for new Mersenne primes?

Yes. The Great Internet Mersenne Prime Search (GIMPS) is a volunteer distributed computing project. Anyone can download the free Prime95 software from mersenne.org and contribute their computer processing power to test Mersenne candidates.

Related Reading

The hunt for our universe's largest prime numbers
Mersenne Prime Record: 41 Million Digits Found by a GPU Cloud
mathematics
Mathematics: The Language That Describes Reality
Prime Numbers
Prime Numbers: Definition, Properties, and Why They Matter
Why 6-7 Are Mathematically Perfect (Despite the Annoying Meme)
Why 6-7 Are Mathematically Perfect (Despite the Annoying Meme)

Sources

  • Great Internet Mersenne Prime Search (GIMPS), mersenne.org
  • Caldwell, Chris K., "Mersenne Primes: History, Theorems and Lists," t5k.org
  • Matsumoto, M. & Nishimura, T. (1998), "Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator," ACM Transactions on Modeling and Computer Simulation, 8(1), 3-30
  • GIMPS press release, "52nd Known Mersenne Prime Discovered" (October 2024), mersenne.org

Fact Check: Claim-by-Claim Verification Verified

All major claims verified against authoritative sources including GIMPS, mersenne.org, and peer-reviewed mathematics literature. Cross-checked via Perplexity sonar-pro-search with full agreement.

1 Supported
Only 52 Mersenne primes are known
Confirmed by GIMPS as of October 2024.
2 Supported
Largest known prime held by Mersenne prime since 1952
The last eighteen record primes have been Mersenne primes per Prime Pages.
3 Supported
Euclid proved perfect number link around 300 BC
4 Supported
Euler completed the proof in 1747
The Euclid-Euler theorem is well-established in mathematical literature.
5 Supported
Mersenne Twister designed in 1997 with period 2^19937 - 1
Confirmed by Matsumoto's homepage and the 1998 ACM TOMACS paper.
6 Supported
Lucas-Lehmer test developed by Lucas in the 1870s
Lucas developed the primality test methods in the 1870s; Lehmer refined them in 1930.
7 Supported
Lucas proved 2^127 - 1 is prime, a 39-digit number
Lucas verified this in 1876. It remained the largest known prime found without computers.
8 Supported
GIMPS started in 1996 and has found 18 Mersenne primes
Confirmed by mersenne.org.
9 Supported
2^136,279,841 - 1 confirmed Oct 2024 by Luke Durant
Confirmed by GIMPS press release. The number has 41,024,320 digits.
10 Supported
Mersenne published his list in 1644 with five errors
Well-documented in number theory literature.
Share
Related Articles
Related Fish Species Make Similar Choices, But How They Choose Differs

Two cichlid species share identical preferences but use different decision rules when choices get hard, a PNAS study of over 5,000 trials finds.

Why We Can Never Prove That Someone Else is Conscious

'Rival' scientists use category theory to show that while 'shapes' of experiences might be matched across minds, we can never observe the feeling itself.

AI Consciousness Is Unlikely, Says Neuroscientist Anil Seth

Neuroscientist Anil Seth argues AI consciousness is unlikely without biology. His TED talk lands amid a widening debate over conscious AI, not intuition.

AI In Science Connects the Dots, But Only In Fields That Are Fragmented

An analysis of 80 million papers shows AI boosts originality where knowledge is scattered and connections are weak, but contributes little novelty in structured science.