cipher.ink Write a message

Primes · Prime numbers

Mersenne Prime: the numbers that are all ones

What a Mersenne prime is, all 52 from Euclid to the 41-million-digit 52nd, the friar, the chessboard, the screensaver years, and what the GPUs changed.

A Mersenne prime is a prime number that is one less than a power of two: 3, 7, 31, 127, and on up to the newest and largest one known, 2136,279,841 − 1, which has 41,024,320 digits and was found in October 2024. Only 52 are known. The oldest four were known to the Greeks, the most recent took a cloud of graphics cards, and in between the hunt for them has pulled in a friar, a schoolteacher with a chessboard, two teenagers on a university mainframe, and, for a few years in the late 1990s, the owner of this site, whose Windows PC spent its idle hours checking exponents for the Great Internet Mersenne Prime Search. This page is the long version: what the name means, why these numbers are the ones that hold the record for the largest known prime, how the test works, who found each one, what the 52nd changed, and what nobody knows yet. The companion page, the list of Mersenne primes, has all 52 in a table with dates, finders and machines.1

Mersenne prime meaning: a row of ones

Write a Mersenne number in binary and you get nothing but ones. 25 − 1 is 31, which is 11111. 27 − 1 is 127, which is 1111111. The record prime, in binary, is 136,279,841 ones in a row and nothing else. That's the whole definition: a Mersenne number is Mn = 2n − 1, and a Mersenne prime is one of those that happens to be prime. The name honors Marin Mersenne, a French friar who published a list of them in 1644, got a third of his new claims wrong, and still ended up with his name on the whole family. More on him below.

Two facts about the exponent fall out of the definition at once, and both matter for the search. First, if 2n − 1 is prime, then n must be prime. The reason is the school identity xab − 1 = (xa − 1)(xa(b−1) + … + xa + 1). Put x = 2: if n = ab, then 2a − 1 divides 2n − 1. In binary that's just the observation that a row of six ones, 111111, is 111 times 1001. So 26 − 1 = 63 = 7 × 9, and nobody tests even or composite exponents. Second, the converse fails. A prime exponent is necessary but nowhere near enough. 211 − 1 = 2,047 = 23 × 89, and that one example, noticed by Hudalricus Regius in 1536, is where the modern subject starts, because before it a lot of people believed every prime exponent gave a prime.2

So the search is a search over prime exponents, and the ones that work are rare. Every prime exponent up to 142,351,031 has now been tested at least once, which is 8,037,433 prime exponents, and 52 of them gave a Mersenne prime. That's one in about 155,000. Nobody knows whether the supply ever stops. There is a well-argued guess, which we'll come to, that says it doesn't, and that there should be about 1.78 of them for every doubling of the exponent. The data agree with it about as well as 52 points can.3

Why the largest known prime is always one of these

The top of the list of known primes is Mersenne primes all the way down to about ten million digits, and the record has been a Mersenne prime for all but a few scattered years since 1876. That isn't because Mersenne primes are common. It's because they're the only enormous numbers anyone can prove prime in reasonable time. For a general 41-million-digit number, there is no known way to settle primality before the sun burns out. For 2p − 1 there is a special test, the Lucas-Lehmer test, that needs only p − 2 squarings, each one cheap because reducing modulo a Mersenne number is a shift and an add rather than a long division. The test has no probabilistic residue either: when it says prime, it is a proof. The record is a Mersenne prime for the same reason the fastest sprint times are set on a track, not in a field.

The test itself is short enough to state in a sentence. Start with 4. Square it, subtract 2, and keep only the remainder modulo 2p − 1. Do that p − 2 times. If the last value is 0, the number is prime, and if it isn't, it isn't. For p = 7 the sequence runs 4, 14, 67, 42, 111, 0, so 127 is prime. For p = 11 it runs 4, 14, 194, 788, 701, 119, 1877, 240, 282, 1736, and never hits zero, which agrees with 23 × 89. For p = 13 it reaches 0 on the eleventh step and 8,191 is prime. You can run those, and any exponent up to 44,497, in the box below. It's the same code the site uses on the largest known prime page, and it also works out the first and last digits of the record without ever building the 41-million-digit number.4

The record, digit by digit

The Lucas–Lehmer test

Everything here runs in your browser. Nothing is sent anywhere.

Why a squaring sequence can prove anything is the beautiful part, and the sketch fits in a paragraph. Set ω = 2 + √3 and ω̄ = 2 − √3, so that ωω̄ = 1. Then the sequence sk is ω2k + ω̄2k: squaring and subtracting 2 is the same as squaring ω. The test asks whether ω2p−2 + ω̄2p−2 is 0 modulo Mp, which turns out to say that ω has order exactly 2p in a certain group built on top of the modulus. If Mp had a prime factor q, that group would be too small to hold an element of order 2p (its size is at most q2 − 1, and q ≤ √Mp for the smallest factor). So there is no factor. The other direction uses quadratic reciprocity to show that for a prime Mp the order really is 2p. The whole argument is a page in any number theory text, and Matthew Baker's 2026 note on the 150th anniversary of Lucas's result gives a clean modern version of it.5

Marin Mersenne, the friar whose list was wrong

Mersenne was born in 1588 near Oizé, in the west of France, and joined the Minims, a particularly austere order of friars, in 1611. From 1619 he lived in the order's convent near the Place Royale in Paris and ran, by letter, what amounted to the scientific internet of his day. He corresponded with Descartes (a school friend), Fermat, Galileo, Pascal, Huygens, Hobbes, Torricelli, Gassendi and dozens of others, forwarded their results to one another, set them problems, and held meetings in his cell that later grew into the Académie des Sciences. Historians call him the secretary of learned Europe. His own science was mostly acoustics and music: his Harmonie universelle of 1636 states what are still called Mersenne's laws, that a string's frequency goes inversely with its length, with the square root of its tension, and inversely with the square root of its mass per unit length. He also made one of the first measurements of the speed of sound.6

The primes come from one paragraph in the preface to his Cogitata Physico-Mathematica of 1644. There he claimed that 2n − 1 is prime for n = 2, 3, 5, 7, 13, 17, 19, 31, 67, 127 and 257, and composite for every other prime exponent up to 257. The first seven were already known. Of the four new claims, two were right (31, proved by Euler in 1772, and 127, by Lucas in 1876), and two were wrong: 267 − 1 and 2257 − 1 are both composite. He also missed three, at 61, 89 and 107. Five errors in a list of eleven, and nobody could have checked most of it with the arithmetic of 1644; Mersenne himself wrote that he hadn't. It took until 1947 for the range up to 257 to be fully settled.7

The most famous correction came in October 1903, at a meeting of the American Mathematical Society in New York. Frank Nelson Cole walked to the board, wrote out 267 − 1 = 147,573,952,589,676,412,927, then wrote 193,707,721 × 761,838,257,287 and multiplied it out by hand until the two matched. He sat down without a word and the room applauded. Asked how long it had taken him, he said "three years of Sundays." Lucas had shown 27 years earlier that the number was composite, but his test gives no factor, so Cole had to find the factors the hard way.8

Why does a man with a 45 percent error rate on his own claims get the numbers named after him? Partly because the alternative names were worse (the numbers had been studied since Euclid without a name), partly because his list was the first attempt at a complete one over a large range, and partly because his letters made him the hub through which every result on the subject passed for thirty years. Fermat's letters of 1640, to Mersenne and to Frénicle, written while Fermat was working on Mersenne's own questions about these numbers, contain the first statements of what we now call Fermat's little theorem. The numbers are a monument to the question, not the answer.9

Two thousand years before Mersenne

The numbers were interesting long before 1644 because of perfect numbers. A perfect number equals the sum of its proper divisors: 6 = 1 + 2 + 3, and 28 = 1 + 2 + 4 + 7 + 14. Euclid proved, in Book IX of the Elements (around 300 BCE), that whenever 2p − 1 is prime, the number 2p−1(2p − 1) is perfect. With p = 2, 3, 5 and 7 that gives 6, 28, 496 and 8,128, the four perfect numbers the ancient world knew. So the first four Mersenne primes, 3, 7, 31 and 127, were known as the ingredients of perfect numbers at least two centuries before Christ. Two thousand years later, Euler proved the converse: every even perfect number has Euclid's form. The two lists are the same list. Each new Mersenne prime is a new perfect number, and the 52nd gives one with 82,048,640 digits. Whether an odd perfect number exists is still open; if one does, it has at least 1,500 digits.10

Nicomachus, around 100 CE, listed the four perfect numbers and guessed, wrongly, that there was one with each number of digits. The fifth Mersenne prime, 213 − 1 = 8,191, appears in an anonymous Latin manuscript of 1456, and some historians credit the 13th-century Egyptian mathematician Ibn Fallus with the same result. Regius broke the "every prime exponent works" belief in 1536 with 2,047. In 1588 Pietro Cataldi of Bologna showed that 217 − 1 = 131,071 and 219 − 1 = 524,287 are prime, by dividing by every prime up to their square roots, and then overreached: he claimed 23, 29, 31 and 37 as well. Fermat disposed of 23 and 37 in 1640 (223 − 1 is divisible by 47, and 237 − 1 by 223), and Euler disposed of 29 in 1738 (a factor of 233). Cataldi's claim about 31 was the one he got right, and Euler proved it in 1772, with the tool Fermat had handed him.11

That tool is the fact that made every later search practical. Any prime factor q of 2p − 1, for an odd prime p, has the form q = 2kp + 1, and also satisfies q ≡ ±1 (mod 8). Both constraints come from Fermat's little theorem and a little group theory: 2 has order exactly p modulo q, so p divides q − 1, and since q − 1 is even, 2p does. Check it against the examples: 2,047 = 23 × 89, and 23 = 2 × 11 + 1, 89 = 8 × 11 + 1. Cole's factors of 267 − 1 are 134 × 1,445,580 + 1 and 134 × 5,685,360,129 + 1. For Euler, proving 231 − 1 = 2,147,483,647 prime meant trying only primes of the form 248k + 1 or 248k + 63 below 46,341, which is a few dozen divisions instead of a few thousand. Euler also noticed the special case that still kills candidates today: if p ≡ 3 (mod 4) and 2p + 1 is also prime, then 2p + 1 divides Mp. That takes out 11, 23, 83, 131, 179 and every other Sophie Germain prime of that shape at a stroke.12

Lucas, a chessboard, and the largest prime ever found by hand

Édouard Lucas was a lycée teacher in Paris who had fought as an artillery officer in the Franco-Prussian war, invented the Tower of Hanoi puzzle (published under the anagram "N. Claus de Siam"), and wrote the first description of dots and boxes. In 1876 he announced that 2127 − 1 = 170,141,183,460,469,231,731,687,303,715,884,105,727 is prime. It is 39 digits long. It stayed the largest known prime for 75 years, until the first computers took over in 1952, and it is still the largest prime ever proved by a person without a machine.13

He did it with the squaring test described above, in a form he had just invented, and the arithmetic is the surprising part. About 120 squarings of a 39-digit number, each followed by a reduction, is a lot of pencil work, so Lucas did it in binary, where reduction modulo 2127 − 1 is folding the top half of the number onto the bottom half. According to Hugh Williams, who traced the method, Lucas laid the work out on a 127 by 127 chessboard, with a pawn on a square for a 1 and nothing for a 0, and shuffled the pawns by fixed rules until only the first row was left holding the residue. He never wrote the intermediate numbers down. His proofs were not quite airtight by modern standards (the gaps are small and were later closed), and Derrick Henry Lehmer, in 1930, tidied the test into the exact form everyone uses now, which is why it carries both names. Lucas died in 1891 at 49, from an infection after a dropped plate at a banquet cut his cheek.14

The same decade produced the quietest discovery on the list. Ivan Pervushin, a priest in the Urals, showed in 1883 that 261 − 1 is prime, filling the first of Mersenne's three gaps. R. E. Powers, an American who did the arithmetic in his spare time, found the other two, 289 − 1 in 1911 and 2107 − 1 in 1914, with Lucas's method, by hand. Those three were the first Mersenne primes found while a larger one was already known. It has happened only three times since, and the list page explains each.15

The computer age: 1952 to 1996

At ten o'clock on the night of January 30, 1952, the SWAC at UCLA, a machine with 256 words of memory, reported that 2521 − 1 is prime. It was the first run of a program Raphael Robinson had written for a computer he had never seen. Less than two hours later the same run reported 2607 − 1. Lucas's record fell twice in one evening, after 75 years, and Robinson's program ran correctly the first time. He added three more that year, at 1,279, 2,203 and 2,281, the last two within 48 hours of each other in October. Lehmer, who directed the work, had been fired from Berkeley two years earlier for refusing a loyalty oath and reinstated when the state supreme court threw the oath out; the SWAC work fell in the gap.16

For the next 44 years the record belonged to whoever had the newest big machine and the patience to run it on something useless. Hans Riesel found 23,217 − 1 on Sweden's BESK in September 1957 and ran it twice to be sure. Alexander Hurwitz found two on an IBM 7090 on November 3, 1961, with a story attached. By one account he read the printout from the back and saw 24,423 − 1 before 24,253 − 1, so the smaller one was never the largest known prime at all; by another, the smaller one held the record for about fifteen minutes. The people involved treated the question as a joke, and it is a joke that recurs: three later primes were found after a larger one. Donald Gillies found three in six weeks in 1963 on the ILLIAC II during its shakedown at the University of Illinois, and the mathematics department there franked its mail for years with a postage meter that read "211213 − 1 IS PRIME". Bryant Tuckerman found 219,937 − 1 on an IBM 360/91 in 1971. That exponent now lives inside every Python installation, as we'll see.17

Then two high school students took the record. Landon Curt Noll and Laura Nickel were at Cal State Hayward's computing center in 1978, with time on a CDC Cyber 174 and advice from Lehmer, and on October 30 their run found 221,701 − 1. It made the national evening news. Noll found the next one alone in February 1979, and David Slowinski, at Cray Research, took it from him two months later with the first Cray-1 result. Slowinski then held the record, with colleagues, for most of two decades: 1979, 1982, 1983, 1985, 1992, 1994 and 1996, each on the newest Cray, usually as part of testing the machine before shipping it. The one interruption was 2110,503 − 1, which Walter Colquitt and Luke Welsh found on a Japanese NEC SX-2 in January 1988. It was smaller than two of Slowinski's primes, because Slowinski had leapt ahead and left exponents behind untested, and it stands as the reminder that a "complete" search needs every exponent below the record cleared.18

George Woltman changed the economics in January 1996. A retired programmer with a taste for assembly language, he wrote a Lucas-Lehmer program for ordinary Intel PCs that was faster, clock for clock, than what the supercomputers ran, by implementing Richard Crandall's trick of doing the giant squarings with a floating-point fast Fourier transform in a weighted number base that makes the Mersenne reduction free. He called the program Prime95, put it on the web with a list of exponents to claim, and called the project the Great Internet Mersenne Prime Search. Luke Welsh, of the 1988 find, supplied the name. In the first year volunteers emailed to request exponents and emailed their results back. On November 13, 1996, Joel Armengaud in Paris reported that 21,398,269 − 1 is prime, on a 90 MHz Pentium. Ten weeks earlier Slowinski and Paul Gage had set the record on a Cray T94. A desktop PC had beaten the supercomputer. No supercomputer has held the record since.19

In 1997 Scott Kurowski built PrimeNet, a server that handed out exponents and collected results automatically, as a demonstration for his volunteer-computing company Entropia. From then on the volunteer's part was to install the program and leave it alone. That is how most people who ran it remember it, including the owner of this site. Her Windows machine ran GIMPS in the late 1990s, a background hunt that ate the cycles nothing else wanted, in the years when SETI@home's waterfall screensaver (launched May 1999, the third big volunteer-computing project after GIMPS and distributed.net) made "donate your idle CPU" a thing people did. Prime95 was quieter than SETI: an icon in the system tray, a window of iteration counts if you opened it, and the knowledge that the exponent on your screen was probably composite and that it would say so in a few weeks. The odds for a single exponent were, and are, long: at the current size, roughly one prime in every 55 million exponents taken at random, improved to something like one in a few hundred thousand once the trial-factoring stages have thrown out the easy composites. Nobody runs it to win. They run it the way people buy one lottery ticket a year, except the ticket also stress-tests the processor, which is why Prime95 became the standard torture test for overclockers and why Patrick Laroche, who found the 51st, had used it for years to check his builds before he let it hunt.20

The finds came steadily for a dozen years: Gordon Spence in 1997 (a 100 MHz Pentium), Roland Clarkson in 1998 (a student, 200 MHz), Nayan Hajratwala in 1999 (an IBM Aptiva, the first prime past a million digits, which collected the Electronic Frontier Foundation's $50,000 award for exactly that), Michael Cameron in 2001 (an Athlon), Michael Shafer in 2003, Josh Findley in 2004, Martin Nowak in 2005, Curtis Cooper and Steven Boone twice at the University of Central Missouri in 2005 and 2006, then the pair of 2008 that got the numbers out of order again: Edson Smith's find on a UCLA mathematics department desktop on August 23, 2008, which crossed ten million digits and earned the EFF's $100,000, and Hans-Michael Elvenich's smaller one in Germany two weeks later. Odd Magnar Strindmo's 2009 prime was smaller than Smith's too, and was reported to the server in April but not noticed until June because of a server bug. The project split the EFF money as its rules said it would: $50,000 to Smith's department, $25,000 to charity, and the rest to earlier finders and the project. Cooper found the 48th in 2013 and the 49th in 2016, and the 49th has the best story of the lot: his computer reported it on September 17, 2015, the email alert failed, and it sat in the database for nearly four months until a maintenance pass turned it up on January 7, 2016. The official discovery date is the day a human noticed. Jon Pace, who had run the software for 14 years, found the 50th on December 26, 2017, and Laroche found the 51st a year later, on his fourth exponent.21

Then nothing, for almost six years. Between December 2018 and October 2024 the project tested every exponent from 83 million to 136 million at least once and found no prime, the longest drought in its history (the previous longest, 2009 to 2013, was under four years). Part of that is bad luck, and part is arithmetic: as the exponents grow, each test costs more and the chance per exponent falls, so the expected wait between finds grows even when the computing power does.22

The 52nd Mersenne prime: the newest, the largest, and the first from GPUs

The newest Mersenne prime is 2136,279,841 − 1. It has 41,024,320 decimal digits, 16 million more than the previous record, and it begins 881694305315… and ends …219486871551. Luke Durant, a 36-year-old researcher in San Jose who had helped design GPUs at NVIDIA, found it with a system he built himself: thousands of server GPUs rented across 24 data center regions in 17 countries, running the project's GPU programs for about a year, at a cost he has put at under two million dollars of his own money. He joined GIMPS in October 2023 and quickly became its largest contributor. He has said he wanted to show that GPUs are good for something besides AI.23

The timeline shows how the modern search differs from the old one. On October 11, 2024, an NVIDIA A100 in Dublin reported the number as a probable prime. On October 12 an H100 in San Antonio ran the full Lucas-Lehmer test and proved it. Over the following week four independent programs on different hardware confirmed it: Prime95 on Intel CPUs (Aaron Blosser), PRPLL and its parent GpuOwl on AMD and NVIDIA GPUs (Durant, James Heinrich, Serge Batalov, Ken Kriesel and Mihai Preda, who wrote GpuOwl in 2017), Mlucas on an Intel CPU (Batalov, running the late Ernst Mayer's program, finishing October 19), and the older CUDALucas on an NVIDIA card. GIMPS announced it on October 21. Official credit, in the project's style, goes to "L. Durant, M. Preda, G. Woltman, A. Blosser, et al.", the finder, the GPU programmer, the founder, the server administrator, and the thousands of volunteers who cleared the exponents around it. It is the first record prime found on a GPU, the first not found by Prime95 since GIMPS began, and the first flagged by a probable-prime test rather than a Lucas-Lehmer test, which is why the project had to decide what the discovery date even was. They chose the day of the proof.24

The asterisk on the rank is real. The project's list calls it the 52nd Mersenne prime provisionally, because the exponents between 82,589,933 and 136,279,841 have each been tested once but not yet all double-checked, and an undiscovered prime could in principle be hiding under a hardware error. The chance is small (modern tests carry an error check that makes a silently wrong result very unlikely) but the project's standard is a verified sweep, and that takes years. The milestones page shows the pace: the 49th was confirmed in its rank on June 23, 2025, the 50th on September 8, 2025, and the 51st on September 4, 2026, when every exponent below 82,589,933 had been verified. As of this writing every test below 83,200,483 is verified and every exponent below 142,351,031 has been tested at least once. The 52nd's rank will be official when the verified line passes 136 million, which at the current rate is years away.25

Durant's prize was $3,000, the project's standard research discovery award, which he gave to the Alabama School of Mathematics and Science. The big money is still unclaimed: the EFF offers $150,000 for the first prime of 100 million digits and $250,000 for a billion. A 100-million-digit Mersenne prime needs an exponent of at least 332,192,807, which is two and a half times the current record.26

How the search works now

An exponent passes through four stages, and most never reach the last one.

  1. Trial factoring. Try every possible prime factor of the form 2kp + 1 with q ≡ ±1 (mod 8) up to some bit size, to somewhere in the mid-70s in bits for current exponents. This is embarrassingly parallel and is almost all done on GPUs now, with a program called mfaktc (mfakto on AMD cards). A factor found here ends the story: the number is composite and nobody runs the expensive test. A large share of exponents die at this stage.
  2. P−1 factoring. Pollard's method finds a factor q whenever q − 1 is a product of small primes, and since q − 1 is a multiple of 2p for Mersenne factors, the method has a head start. It catches factors trial division would never reach.
  3. The PRP test. Since 2018 the first full test is a Fermat probable-prime test to base 3 rather than a Lucas-Lehmer test, because of two things invented for it. Robert Gerbicz's error check verifies the running computation against itself every few thousand iterations, so a flipped bit is caught and redone rather than silently poisoning months of work; the project quotes better than 99.999 percent confidence that a PRP result is correct. And since 2020 the test emits a proof file, using Krzysztof Pietrzak's verifiable delay function construction, that lets anyone confirm the result at about one percent of the cost of rerunning it. That is why first-time Lucas-Lehmer tests were retired in April 2021: a Lucas-Lehmer run can only be checked by running it again.
  4. The proof. If, and only if, the PRP test says "probably prime", several Lucas-Lehmer tests on different programs and hardware settle it. Every exponent below the record also gets its PRP result verified, by the proof file or a second run, which is the double-checking that makes a rank official.

The test itself is a squaring loop. For the record, that means 136 million squarings of a 136-million-bit number, each done with an FFT of a few million points in double-precision floating point and a weighted base that keeps the Mersenne reduction free. Woltman's gwnum library does this on CPUs in hand-tuned assembly for each generation of chip; GpuOwl and PRPLL do it in OpenCL and CUDA. A current exponent takes a modern desktop core a couple of weeks and a data center GPU a few hours, which is why one man with a GPU budget could outrun 28 years of PCs. The project's total throughput was about 4.7 petaflops in 2022, and the Prime95 license says that any EFF prize won with the program is split by the project's rules rather than kept by the finder, which is why third-party programs like GpuOwl, Mlucas and mfaktc exist outside that agreement.27

Explanation of the pattern: how many should there be?

Nobody has proved that there are infinitely many Mersenne primes, or that there are infinitely many Mersenne composites, which is nearly as embarrassing. What exists instead is a heuristic, worked out independently by Hendrik Lenstra and Carl Pomerance around 1980 and refined by Samuel Wagstaff in 1983. The reasoning goes: a random number near 2p is prime with probability about 1/(p ln 2), but a Mersenne number is not random. Its factors have the special form 2kp + 1, so it has already dodged every small prime, and a number that has dodged the primes up to P is prime with probability boosted by the product of q/(q − 1) over those primes. Mertens's theorem turns that product into eγ ln P, with γ the Euler-Mascheroni constant, 0.5772…. Put the pieces together and the chance that 2p − 1 is prime, for prime p, comes out near eγ/(p ln 2). Sum that over primes and the expected number of Mersenne primes with exponent below x is about (eγ/ln 2) ln x, which is 2.57 ln x. Three consequences are easy to check against the real list.28

  • About 1.78 per doubling. Doubling the exponent should add eγ ≈ 1.78 primes on average. Equivalently, successive exponents should grow by a factor of 21/eγ = 1.4758 on average. Over all 51 steps in the known list the geometric mean ratio is 1.424, close. Over the last 20 steps it is 1.297, which is low, and that's not a contradiction, it's the drought's mirror image: the recent primes came closer together than the model expects, and then came a long gap.
  • Expected 48, found 52. The formula predicts 48.1 Mersenne primes with exponent up to 136,279,841, against 52 found. We're running a little ahead of the forecast, by about the amount you'd expect from the noise in a count of 52. A table of the heuristic against every prefix of the list is on the list page.
  • What's next. If the ratio rule held exactly, the 53rd would have an exponent near 201 million and the 54th near 297 million. It never holds exactly; the real ratios range from 1.011 (between 4,253 and 4,423) to 4.10 (between 127 and 521). On the same heuristic there should be about two more Mersenne primes between the current tested frontier of 142 million and the 332 million needed for the 100-million-digit prize, and about eight between the record and the exponent for a billion digits. All of that is a guess with a formula attached. A proof of any of it would be a sensation.

The same arithmetic explains why the record always grows in jumps of roughly the same proportion rather than the same size, and why the plot of log log Mn against n is nearly a straight line. An older conjecture by Donald Gillies, from his 1963 ILLIAC work, predicted a slope about 11 percent steeper and is now thought to be wrong, since it clashes with the prime number theorem.28

Where Mersenne primes turn up when you're not looking

The project's own FAQ admits that the big ones are good for nothing in particular, and that's true of the record. The small ones are everywhere, for the reason Lucas discovered on his chessboard: arithmetic modulo a Mersenne number is a shift and an add.

  • The biggest signed integer on your computer. The largest value of a signed 32-bit integer, 2,147,483,647, is 231 − 1, Euler's prime from 1772. The largest signed 8-bit value, 127, is Lucas's little brother, and the largest signed 128-bit value is 2127 − 1, the exact number Lucas proved prime in 1876. The 16-bit and 64-bit maxima, 32,767 and 263 − 1, are composite (7 × 31 × 151, and 72 × 73 × 127 × 337 × 92,737 × 649,657). So a C programmer's INT_MAX is a Mersenne prime by accident of history, and the reason it matters is the next item.
  • Random number generators. Lehmer, of the Lucas-Lehmer test, proposed in 1949 the generator x → ax mod m, and the version Stephen Park and Keith Miller pushed as a "minimal standard" in 1988 uses m = 231 − 1 with a = 16,807 (later 48,271), chosen because the modulus is prime, fits a machine word, and reduces cheaply. The Mersenne Twister, the default generator in Python, Ruby, PHP and R, takes its name and its period of 219,937 − 1 from Tuckerman's 1971 prime: the generator's state is a shift register whose characteristic polynomial has to be primitive, and that's easy to arrange exactly when the period is a known prime. Neither is safe for secrets, which the random numbers page explains.
  • Elliptic curves. The NIST curve P-521 is defined over the field of 2521 − 1 elements, Robinson's first SWAC prime, picked because reduction mod a Mersenne prime is nearly free. Microsoft's FourQ curve runs over 2127 − 1 for the same reason. The elliptic curves page has the details.
  • Hashing. Polynomial string hashes and universal hash families in competitive programming and in some libraries use 261 − 1, Pervushin's prime, as the modulus, because a 61-bit product fits in a 128-bit register and reduces with one shift and one add. The same trick with 231 − 1 is older than the 64-bit register.
  • Perfect numbers, and a party trick. Every even perfect number is 2p−1(2p − 1) for a Mersenne prime, so the list of perfect numbers has exactly 52 known entries too. And every even perfect number except 6 has a digit sum that, summed repeatedly, reaches 1: 28 → 10 → 1, 496 → 19 → 10 → 1, 8,128 → 19 → 1. That's the statement that they're all 1 mod 9, which falls out of the form.

There's a reason this site, which exists to encrypt messages in your browser, cares about any of this. Public-key cryptography lives on primes, but on a different kind: RSA wants two random primes of about 300 digits each and gets them in milliseconds, as the RSA primes page shows live. Mersenne primes are the opposite kind of object: predictable in form, rare, and enormous. The one place the two worlds touch is the modulus of an elliptic curve or a hash, where "predictable in form" is exactly what you want.29

How big is 41 million digits?

Numbers this size defeat intuition, so here are some measurements, all computed rather than quoted. The record prime is 136,279,841 bits, so stored as plain binary it is 17,034,981 bytes, about 16 MiB, which fits on a dozen floppy disks or in one phone photo. Written out in decimal at 3,000 digits a page it is 13,675 pages. Printed on one line in a 12-point monospace font it would be about 65 miles long. Read aloud at three digits a second without stopping it takes 158 days, or about a year and a quarter of eight-hour shifts. The GIMPS press release puts it as "over 41 million digits"; the digit count itself, 41,024,320, is just ⌊136,279,841 × log10 2⌋ + 1, and the leading digits come from the fractional part of that same logarithm, which is how the tool above produced them.30

What nobody knows

  • Are there infinitely many? Probably, on the heuristic above, but unproved. Also unproved: that infinitely many Mersenne numbers with prime exponent are composite, although Euler's 2p + 1 result would settle it if there are infinitely many Sophie Germain primes of the form 4k + 3, which is itself unproved.
  • Is every Mersenne number square-free? A repeated prime factor q would make q a Wieferich prime (one with 2q−1 ≡ 1 mod q2), and only two of those are known, 1,093 and 3,511, neither of which divides a Mersenne number with prime exponent. No square factor has ever been found. No proof that none exists either.
  • The New Mersenne Conjecture. Paul Bateman, John Selfridge and Wagstaff proposed in 1989 that for an odd prime p, if any two of the following hold, so does the third: p is of the form 2k ± 1 or 4k ± 3; 2p − 1 is prime; (2p + 1)/3 is prime. It is consistent with every known case and is believed to be true for an uninteresting reason: for large p all three conditions are expected to be false.
  • Double Mersenne numbers. Take a Mersenne prime as the exponent of another: 22p−1 − 1. For p = 2, 3, 5, 7 the result is prime (7, 127, 231 − 1 and 2127 − 1, so Lucas's prime is a double Mersenne prime). For p = 13, 17, 19 and 31 it's composite. The next candidate, 2261−1 − 1, has about 694 quadrillion digits, is far beyond any test, and a volunteer project has searched for a factor for decades without finding one.
  • The Catalan-Mersenne sequence. 2, 3, 7, 127, 2127 − 1, each one 2previous − 1. All five are prime. Whether the sixth is prime is unknowable with current methods, which hasn't stopped people from guessing it isn't.
  • Odd perfect numbers. None known, none ruled out. Any that exists is above 101500 and has at least ten distinct prime factors.31

The folding trick, worked by hand

Everything about these numbers that is cheap comes from one observation: modulo 2p − 1, the number 2p is 1. So any bit that overflows past position p can be folded back onto position 0. Take the Lucas-Lehmer step for p = 7, where the modulus is 127 and the current value is 67, which is 1000011 in binary. Squaring gives 4,489, or 1000110001001 in binary, thirteen bits. Split it after the seventh bit from the right: the low part is 0001001 (9) and the high part is 100011 (35). Add them: 44. Subtract the 2 from the test: 42. That's the next term in the sequence, and it agrees with the long division 4,487 mod 127 = 42. No division ever happened. For the record, the "number" is 136 million bits wide, the squaring is done by a fast Fourier transform, and the fold is built into the transform's weights so that it costs nothing at all, which is Crandall and Fagin's 1994 idea and the reason Woltman's 1996 program could outrun a Cray. It is also, in a smaller way, why a Mersenne prime makes a good modulus for a random number generator or a hash: the reduction is a shift, a mask and an add.

How long a record lasts

Since Lucas, 38 Mersenne primes have taken the title of largest known prime, and the table shows how long each kept it, computed from the discovery dates. Lucas's 76 years is the outlier and will not be matched. The 1952 SWAC run set and broke the record five times in nine months. In the GIMPS era the record has typically lasted one to three years, and the current one, at two years and counting, is already ordinary. The longest hold since 1952 belongs to the 51st, at 5.8 years, which is the drought described above.

ExponentBecame the recordHeld for
127January 10, 187676.1 years
521 and 607January 30, 19520.4 years
1,279June 25, 19520.3 years
2,203 and 2,281October 7 and 9, 19524.9 years
3,217September 8, 19574.2 years
4,253 and 4,423November 3, 19611.5 years
9,689, 9,941 and 11,213May 11 to June 2, 19637.8 years
19,937March 4, 19717.7 years
21,701October 30, 19780.3 years
23,209February 9, 19790.2 years
44,497April 8, 19793.5 years
86,243September 25, 19821.0 year
132,049September 19, 19832.0 years
216,091September 1, 19856.5 years
756,839February 19, 19921.9 years
859,433January 4, 19942.7 years
1,257,787September 3, 19960.2 years
1,398,269November 13, 19960.8 years
2,976,221August 24, 19970.4 years
3,021,377January 27, 19981.3 years
6,972,593June 1, 19992.5 years
13,466,917November 14, 20012.0 years
20,996,011November 17, 20030.5 years
24,036,583May 15, 20040.8 years
25,964,951February 18, 20050.8 years
30,402,457December 15, 20050.7 years
32,582,657September 4, 20062.0 years
43,112,609August 23, 20084.4 years
57,885,161January 25, 20132.9 years
74,207,281January 7, 20162.0 years
77,232,917December 26, 20170.9 years
82,589,933December 7, 20185.8 years
136,279,841October 12, 2024still the record

Two things the table hides. The record was not always a Mersenne prime: in 1951 Aimé Ferrier found a 44-digit prime with a desk calculator, and Miller and Wheeler found a 79-digit one on the EDSAC, and both briefly beat Lucas; and in 1989 a team at Amdahl held the record for three years with a prime of the form k × 2n − 1. And three Mersenne primes never held the record at all because a bigger one was already known: 110,503, 37,156,667 and 42,643,801.32

From found to official: the slowest part of the search

A find takes a day to confirm and years to rank. Here is the lag for the last four primes whose rank is settled, from the discovery date to the milestone entry declaring every smaller exponent verified: the 48th took 8.7 years (January 2013 to October 2021), the 49th 9.5 years (January 2016 to June 2025), the 50th 7.7 years (December 2017 to September 2025) and the 51st 7.7 years (December 2018 to September 2026). The 52nd sits 54 million exponents above the 51st, so on that pace its asterisk comes off in the 2030s. In practice the double-checking is now mostly proof verification rather than second runs, and GPUs have moved the verified frontier faster in 2025 and 2026 than in any year before, so it may be sooner. Until then "52nd" is a strong expectation, not a theorem.33

The ones that fail: a factor table

It helps to see what a composite Mersenne number looks like, because the factors all obey the 2kp + 1 rule and the pattern is visible at once. Here is every prime exponent below 60 that does not give a Mersenne prime, with the factorization and the k for each factor.

p2p − 1k in 2kp + 1Who settled it
1123 × 891, 4Regius, 1536
2347 × 178,4811, 3,880Fermat, 1640
29233 × 1,103 × 2,0894, 19, 36Euler, 1738
37223 × 616,318,1773, 8,328,624Fermat, 1640
4113,367 × 164,511,353163, 2,006,236Plana, 1859
43431 × 9,719 × 2,099,8635, 113, 24,417Euler / Landry
472,351 × 4,513 × 13,264,52925, 48, 141,112Euler / Reuschle, 1856
536,361 × 69,431 × 20,394,40160, 655, 192,400Landry, 1869
59179,951 × 3,203,431,780,3371,525, 27,147,726,952Landry, 1869

Notice how often the smallest factor has k = 1, meaning 2p + 1 itself divides the number: 11, 23 and (further up) 83, 131, 179 all die that way, which is Euler's Sophie Germain observation at work. Notice also how the list of who settled each one reads like the history of computation: Regius and Fermat by insight, Euler by his factor rule, the 19th-century French arithmeticians Landry and Reuschle by years of division, and everything past 100 by machine. The factors above are recomputed on the page's build script by plain trial division, which takes a few seconds for these and would take longer than the universe for 2136,279,841 − 1, which is the whole point of the Lucas-Lehmer test.34

Running the search yourself

If the owner's late-1990s experience makes you want to try it, the shape of the thing hasn't changed, only the scale. You create an account at mersenne.org, install Prime95 (or mprime on Linux, or GpuOwl and mfaktc for a graphics card), and the PrimeNet server hands you an exponent and a job type. The default job for a newcomer is a first-time PRP test on an exponent somewhere above 142 million, which on a current desktop core runs for one to three weeks and reports a residue when it finishes. Trial factoring on a GPU is the other common choice: a job takes minutes to hours, it finds a factor a few percent of the time, and every factor found is an exponent nobody has to test. The program runs at the lowest priority the operating system offers, so it yields to anything else you do. The things people learn in the first month: that a laptop will run hot, that the "torture test" menu item is why the program is famous among overclockers, that the probability of your particular exponent being the one is on the order of one in several hundred thousand, and that the project publishes every result, so a factor you find at 2 a.m. is on the site by breakfast with your name beside it. Nobody has found a Mersenne prime on a phone, and no, you can't run it in a browser tab: the FFT needs the memory bandwidth of a real machine, which is why this page's tool stops at 44,497.35

Fifty-two primes by century

Four before Christ, one in the 1400s, two in the 1500s (Cataldi), none at all in the 1600s (Mersenne's century produced the list and no new entries), one in the 1700s (Euler), two in the 1800s (Lucas and Pervushin), 28 in the 1900s and 14 so far in the 2000s. The 1900s split neatly: two by hand before the war (Powers), then 26 by machine from 1952. If the heuristic is right and the search keeps its current pace, the 2000s will end with something like ten more, and the 2100s will inherit a search for primes with exponents in the billions, each test as far beyond today's as today's is beyond Robinson's 256 words of memory.36

Common questions

What is the 52nd Mersenne prime?

2136,279,841 − 1, with 41,024,320 digits, found by Luke Durant on October 12, 2024, through GIMPS. "52nd" is provisional until every exponent below it has been double-checked, which will take years. It is also the largest known prime of any kind.

What is the newest Mersenne prime?

The same one. As of our last check of the GIMPS list, on October 26, 2026, no prime has been found since October 2024. Every exponent below 142,351,031 has been tested at least once.

How many Mersenne primes are there?

52 known, with exponents 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1,279, 2,203, 2,281, 3,217, 4,253, 4,423, 9,689, 9,941, 11,213, 19,937, 21,701, 23,209, 44,497, 86,243, 110,503, 132,049, 216,091, 756,839, 859,433, 1,257,787, 1,398,269, 2,976,221, 3,021,377, 6,972,593, 13,466,917, 20,996,011, 24,036,583, 25,964,951, 30,402,457, 32,582,657, 37,156,667, 42,643,801, 43,112,609, 57,885,161, 74,207,281, 77,232,917, 82,589,933 and 136,279,841. Whether there are infinitely many is open. The list page has each one with its finder and date.

Is 1 or 22 − 1 = 3 the first Mersenne prime?

3 is the first. 21 − 1 = 1 is not prime, and 20 − 1 = 0 is nothing. Some older books count only odd exponents and start at 7; the modern lists, including GIMPS's, start at 3.

Why are they named after someone who got the list wrong?

Because his 1644 list was the first serious attempt at a complete one, because his letters were how every result on the subject traveled in the 1600s, and because the numbers had no name before him. The errors (67 and 257 in, 61, 89 and 107 out) took until 1947 to settle.

Could I find the next one?

Yes, with the GIMPS software and a lot of patience. A modern desktop takes a week or two per exponent, the chance per exponent after factoring is on the order of one in a few hundred thousand, and the current frontier is above 142 million. Most volunteers run it because it costs nothing, because it stress-tests the machine, and because 17 of the 52 were found on ordinary PCs by people exactly like them.

Why isn't every exponent above the record tested yet, if GPUs are so fast?

Because testing is only half the job. A rank is official when every smaller exponent has been tested twice with matching results, and the verified frontier moves more slowly than the tested one. In September 2026 the verified line passed the 51st prime, seven and three-quarter years after it was found.

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

2n − 1 for any n is a Mersenne number; 63 and 2,047 are Mersenne numbers. Only the prime ones, 3, 7, 31, 127, 8,191 and so on, are Mersenne primes. Some authors restrict "Mersenne number" to prime exponents, so that 2,047 is one and 63 isn't.

Notes

  1. The count of 52, the exponents, dates and finders throughout are from the GIMPS list of known Mersenne primes, mersenne.org/primes, read October 26, 2026. The 52nd is marked provisional there. back
  2. Regius's 1536 observation and the early history are in Chris Caldwell's Mersenne Primes: History, Theorems and Lists at the Prime Pages. back
  3. The count of prime exponents below 142,351,031 (8,037,433) is a sieve in scripts/examples/mersenne-list.mjs, which also computed every other figure on this page that isn't a quotation. The "tested at least once" frontier is from the GIMPS milestones report, entry of October 15, 2026. back
  4. The three example sequences are from the same script; the cutoff of 44,497 in the box is the site's own time limit for a browser tab, not a property of the test. back
  5. Matthew Baker, The sesquicentennial of the prime number 2127 − 1, Notices of the AMS 73 (2026), gives the history and a modern proof. The group in the sketch is the multiplicative group of Z[√3] modulo q. back
  6. Life and correspondence: the Stanford Encyclopedia of Philosophy entry on Mersenne; the acoustics are in Mersenne's laws. back
  7. The 1644 list and its five errors: Mersenne conjectures and OEIS A109461, which is Mersenne's list as he printed it. The 1947 date for the completed check of n < 258 is from Caldwell's history. back
  8. Cole's 1903 talk is told in E. T. Bell's Mathematics: Queen and Servant of Science and summarized in Wikipedia's article on Cole; the factors are checked by multiplication in the script. Lucas's 1876 proof that M67 is composite is in the same Comptes Rendus notes as his M127 result. back
  9. Fermat's 1640 letters and their place in the history of the little theorem: Fermat's little theorem, history. back
  10. Euclid, Elements IX.36 (Joyce's edition); Euler's converse is in his posthumous Tractatus. The bound of 101500 for an odd perfect number is Ochem and Rao, Mathematics of Computation 81 (2012). back
  11. The 1456 manuscript, Ibn Fallus, Cataldi's claims and Fermat's and Euler's corrections follow the history table in Wikipedia's list and Caldwell's history; the factors 47, 223 and 233 are checked in the script. back
  12. The factor theorems and Euler's 2p + 1 result: Caldwell's history (theorems three and four) and Wikipedia's Mersenne prime article. Euler's residues 1 and 63 mod 248 for M31 are the two classes that satisfy both constraints at once. back
  13. Lucas's life: Wikipedia and Baker's note. The "largest prime proved by hand" claim is Baker's. back
  14. The chessboard description is Hugh Williams's, in Édouard Lucas and Primality Testing (Wiley, 1998), as reported by Baker. Lehmer's 1930 paper is "An extended theory of Lucas' functions", Annals of Mathematics 31. back
  15. Pervushin and Powers: the GIMPS list and Caldwell's history. The three later out-of-order finds are 2110,503 − 1 (1988), 237,156,667 − 1 (2008) and 242,643,801 − 1 (2009). back
  16. Robinson's own account, "Mersenne and Fermat numbers", Proceedings of the AMS 5 (1954), reproduced at the Prime Pages; the 10 pm detail is in Wikipedia's Mersenne prime article. Lehmer and the loyalty oath: Baker's note. back
  17. Riesel's note on the two BESK runs is reproduced at the Prime Pages; the Hurwitz accounts are compared at ProofWiki; Gillies and the ILLIAC II are in Wikipedia's ILLIAC II article. back
  18. Noll and Nickel, "The 25th and 26th Mersenne primes", Mathematics of Computation 35 (1980); the Slowinski and Colquitt-Welsh dates are the GIMPS list's. back
  19. The founding, Crandall's algorithm, Welsh's name and the Armengaud find: GIMPS history and the 2024 press release. The weighted transform is Crandall and Fagin, "Discrete weighted transforms and large-integer arithmetic", Mathematics of Computation 62 (1994). back
  20. PrimeNet and Entropia: Wikipedia's GIMPS article. SETI@home as the third project, after GIMPS and distributed.net: SETI@home Classic: In Memoriam. The one-in-55-million figure is eγ/(p ln 2) at p = 142 million, from the heuristic below; the post-factoring odds are the project's own order-of-magnitude figure. The owner's recollection is hers; the program's tray icon and iteration window are described in the Prime95 documentation of the period. Laroche's stress-testing habit: the 2018 press release. back
  21. Each find's date, hardware and story: the GIMPS list and press releases; the Strindmo server error and the Cooper email failure are in Wikipedia's list page and the 2016 press release; the EFF prize split is in the 2008 one. The EFF award dates are from the EFF Cooperative Computing Awards page. back
  22. The gap lengths are computed from the discovery dates in the script. back
  23. The GIMPS press release of October 21, 2024; the cost is Durant's own estimate in interviews (Science Friday). The first and last twelve digits are from the script. back
  24. The press release; the discovery-date question is discussed in The Register's report. back
  25. The milestones report, entries of June 23, 2025, September 8, 2025, September 4, 2026 and October 15, 2026. back
  26. The prize and the donation: the press release. The exponent for 100 million digits is ⌈(108 − 1) / log10 2⌉, from the script. back
  27. The pipeline: How GIMPS works, Wikipedia's GIMPS article (the 2018 PRP switch, Gerbicz checks, the 2020 proofs, the 2021 retirement of first-time LL tests, the 2022 throughput), and the Prime95 30.3 release notes for the cost of checking a proof. Gerbicz's check is described at Prime-Wiki. back
  28. Caldwell's heuristics page, following Wagstaff, "Divisors of Mersenne numbers", Mathematics of Computation 40 (1983). The ratios, the expected counts and the projected exponents are computed in the script. Gillies's conjecture: Wikipedia. back
  29. Signed-integer maxima and their factorizations are checked in the script. Park and Miller, "Random number generators: good ones are hard to find", Communications of the ACM 31 (1988); the Mersenne Twister; Lehmer generators; FIPS 186-5 for P-521; the FourQ paper is Costello and Longa, Asiacrypt 2015. back
  30. All in the script: bytes, pages at 3,000 digits, miles at 0.1 inch per digit, and days at three digits a second. Science Focus arrived at 237 days with a slower reader. back
  31. The open problems follow Caldwell's history page (double Mersenne numbers, the Catalan sequence, square-freeness, the New Mersenne Conjecture) and Wikipedia on odd perfect numbers (Nielsen's bound of ten distinct prime factors, 2015). Bateman, Selfridge and Wagstaff, "The new Mersenne conjecture", American Mathematical Monthly 96 (1989). back
  32. The record durations are computed from the GIMPS list dates in scripts/examples/mersenne-list.mjs. Ferrier, Miller and Wheeler (1951) and the Amdahl Six (1989): Wikipedia, largest known prime number. back
  33. Discovery dates from the GIMPS list; confirmation dates from the milestones report, computed in the script. back
  34. Factorizations recomputed in the script. Who first found each factor is from the Prime Pages history and Wikipedia's Mersenne prime article; Plana (1859), Landry (1869) and Reuschle (1856) are the dates given there. back
  35. Job types, run times and the priority setting are from How GIMPS works and the current Prime95 documentation. back
  36. Counts by century from the script, grouping the GIMPS list's dates. back

Further reading

  1. GIMPS: Known Mersenne primes (checked October 26, 2026)
  2. GIMPS: milestones report
  3. GIMPS: press release, M136279841 is the new largest known prime (October 21, 2024)
  4. Caldwell: Mersenne primes, history, theorems and lists (The Prime Pages)
  5. Caldwell: Heuristics model for the distribution of Mersenne primes
  6. Baker: The sesquicentennial of the prime number 2^127 - 1, Notices of the AMS 73 (2026)
  7. Stanford Encyclopedia of Philosophy: Marin Mersenne
  8. Wagstaff: Divisors of Mersenne numbers, Mathematics of Computation 40 (1983)
  9. Noll and Nickel: The 25th and 26th Mersenne primes, Mathematics of Computation 35 (1980)
  10. EFF: Cooperative Computing Awards