Image: Evan-Amos (public domain)The largest known prime and how it was found
The largest known prime number is 2^136279841 - 1. Written out it has 41,024,320 decimal digits, enough to fill about 12,000 pages of a paperback, and nobody has printed it. It was found by the Great Internet Mersenne Prime Search, GIMPS, on 12 October 2024, on a computer rented in a cloud data centre, and it is the 52nd known prime of its particular form. The previous record, from 2018, had 24,862,048 digits.
Why record primes look like this
Every record prime since 1952, with one exception in 1989, has been a Mersenne number, a number of the form 2^p - 1. The reason is a test. For general numbers, proving primality takes time that grows quickly with the size, and a 41-million-digit number of no special shape would be out of reach. For 2^p - 1 there is the Lucas-Lehmer test: start with 4, and p - 2 times in a row replace the current value s by s² - 2 reduced modulo 2^p - 1. The number 2^p - 1 is prime if and only if the final value is 0. For p = 7, the sequence modulo 127 is 4, 14, 67, 42, 111, 0, so 127 is prime. Édouard Lucas found the test in 1876 and used it, by hand and in a weaker form, to prove that 2^127 - 1, a 39-digit number, is prime; Derrick Henry Lehmer gave the modern form and proof in 1930, and Unit 6 of the masterclass states the test next to the perfect numbers that Mersenne primes produce.
Each step of the test squares a number of 136 million bits, which is the real cost. Done naively that is 10¹⁶ multiplications of digits per step, times 136 million steps. Done with the fast Fourier transform, as every serious program does, a squaring costs about as much as a few hundred million multiplications, and a single test of the record exponent takes a strong processor several weeks or a graphics card about a day. For the exponent to matter, p must itself be prime, since 2^(ab) - 1 is divisible by 2^a - 1, so the search runs through prime exponents, and 136,279,841 is one.
GIMPS
George Woltman founded GIMPS in January 1996 as a program, later called Prime95, that volunteers could run on their own computers, each taking an exponent from a central server, testing it, and reporting back. Since then the project has found every new Mersenne prime, 18 of them. The 1996 record, 2^1398269 - 1, had 420,921 digits; the first ten-million-digit prime came in 2008 and won a prize of 100,000 US dollars from the Electronic Frontier Foundation, which still offers 150,000 dollars for the first with a hundred million digits. Hundreds of thousands of computers have taken part over the years.
The project also double-checks. Every exponent below a prime found is tested at least twice, on different hardware, to make sure that no Mersenne prime has been missed, and a mistaken "prime" report would be caught by the verification that follows every claim. In 2024 the project recorded that all exponents below the 51st Mersenne prime had been tested twice, so that prime is known to be the 51st, while the number found in 2024 is "the 52nd known": there could be an undiscovered one between.
What happened in 2024
The 2024 prime was found by Luke Durant, a researcher and former NVIDIA engineer in San Jose, who in 2023 had set up a system to run the GIMPS software on thousands of rented graphics processors across 24 data-centre regions in 17 countries. The processors ran a program called GpuOwl, written by Mihai Preda, which performs a Fermat probable-prime test rather than the Lucas-Lehmer test, the test described in the article on primality testing, with a proof-of-work scheme that lets the result be verified cheaply. On 11 October an NVIDIA A100 in Dublin reported that the number was probably prime. On 12 October an H100 in San Antonio confirmed it with a full Lucas-Lehmer test, and over the following week the result was reproduced with four different programs on CPUs and on AMD and NVIDIA processors by five volunteers. GIMPS took 12 October as the official date, and announced the prime on 21 October 2024.
It was the first record found with a probable-prime test rather than directly with Lucas-Lehmer, and the first found on graphics hardware, which ended what GIMPS called the 28-year reign of ordinary personal computers. It was also found in a cloud, by a single contributor paying for the computation, rather than by a volunteer's desktop, and that shift is likely to continue: the next prime will need tests of 150-million-digit numbers, each taking a GPU about a day, over millions of candidate exponents.
Why anyone bothers
The number itself is of no use. Cryptography needs primes of a few hundred digits, and there are more of those than atoms in the universe, found in milliseconds. The search is a benchmark and a hobby, and on the way it has found hardware bugs: the Prime95 torture test is a standard tool for checking that a new processor does arithmetic correctly, and in 1994 Thomas Nicely, computing the sum of the reciprocals of twin primes, found the division bug in the Pentium that cost Intel 475 million dollars. Beyond that, the question of whether there are infinitely many Mersenne primes, and therefore infinitely many perfect numbers, is open, and every new one is a data point for the heuristics that predict how often they appear.
Unit 1 of the masterclass uses the record prime for its first calculation: how many digits does 2^136279841 - 1 have? Since log₁₀ 2 = 0.30103, the exponent times that is 41,024,319.2, and the number of digits of an integer n is the floor of log₁₀ n plus one, so 41,024,320 digits, without computing the number. The same unit, which is about what a proof is, points out that the primality of the record is a theorem in the full sense, proved by an algorithm with a mathematical correctness proof and repeated on independent machines, while the statement that it is the 52nd Mersenne prime is at present only probable.
Where to look
The list of known Mersenne primes at mersenne.org gives all 52 with their discoverers and dates, from 3, 7, 31, and 127 known in antiquity, through 2^31 - 1 proved prime by Euler in 1772 and 2^127 - 1 by Lucas, to the 2024 record. The Prime Pages keep the list of the 5,000 largest known primes of all forms, on which the Mersenne primes hold the top places and primes of the form k × 2ⁿ + 1, found by the PrimeGrid project, fill most of the rest. Both are weekly resources of the masterclass, in Units 3 and 8, and both can be joined by anyone with a computer and the patience to let it run.


