Mersenne Primes, GPUs, and a Number With 41 Million Digits
Andrei Mihai
In October 2024, mankind found a new prime number. It was also the largest prime number, featuring a gargantuan 41,024,320 digits. The number (defined as 2136,279,841 – 1) was special for another reason: It did not come as a result of a new equation or algorithm, nor did it come as a result of CPU calculation. No, this number was discovered through a GPU-driven workflow.
Orchestrated by researcher Luke Durant, the effort utilized a global cloud supercomputer spanning 17 countries and 24 data center regions, leveraging the parallel processing power of thousands of high-performing GPUs. But why does finding this number matter?
Mersenne Primes

Mersenne numbers take the form Mp = 2p – 1, where p is an integer. A fundamental theorem of number theory dictates that if Mp is prime, then p must itself be a prime number. However, the relationship is not reciprocal, and the primality of p does not guarantee the primality of Mp.
Primes of this specific form are known as Mersenne primes, named after the 17th-century French monk Marin Mersenne, who studied them extensively. Mersenne the monk was a polymath and his seminal work on music theory, Harmonie universelle, is widely regarded as the first major study of acoustics. He also developed Mersenne’s laws, which describe the harmonics on a vibrating string. Yet for mathematicians, his most enduring work is in primes.
Mersenne primes have fascinated mathematicians for centuries due to their direct connection to perfect numbers, integers equal to the sum of their proper divisors. According to the Euclid-Euler theorem, every even perfect number can be expressed in the form 2p-1(2p – 1), where 2p – 1 is a Mersenne prime.
There is another reason why Mersenne primes get special treatment: They are easy to test for.
There are infinitely many prime numbers, a fact mathematicians have known since antiquity. So while we cannot find the “last” prime number, we can keep finding bigger and bigger ones. But when the numbers get very large, it is not easy to see whether they are in fact primes.
In practice, researchers keep pushing that boundary outward by testing numbers that are especially well suited to modern computation. That is why so many record-holders are Mersenne primes, even though they are relatively rare: They can be tested through efficient methods like the Lucas-Lehmer test. We have most likely missed out on a number of smaller prime numbers because testing them is inefficient.
For Mersennes, the standard test (called the Lucas-Lehmer test) is elegant. You start with a fixed value, repeat a specific squaring and reduction process, and after enough rounds, you see whether the number passes or fails. It is a deterministic test, and a narrow one, and it is substantially faster than the algorithms that can be used for other types of primes.
When you work with binary hardware, reduction modulo 2p – 1 can be done with shifts and additions instead of division, which is more computationally intensive. Reduction modulo just means taking a very large number and replacing it with its remainder after division by another one. In the Lucas-Lehmer test, the computer keeps producing enormous intermediate values, far too large to handle efficiently if it carried every digit forever. So after each step it trims them back into a manageable range by computing that remainder.
The real breakthrough here, however, was not just finding a bigger prime. It was proving that the structure of the problem finally matches the structure of modern GPU hardware.
GPUs Are Taking Over

For years, CPUs were at the core of this prime-searching quest. It is not necessarily because they were ideally suited for the task, but rather because they were everywhere. This made it easier for remote people to work together in initiatives like GIMPS.
GIMPS (the Great Internet Mersenne Prime Search) was founded in 1996 by computer scientist George Woltman. It was one of the first global collaborative computing initiatives and it has found 18 Mersenne primes, 16 of which were the largest when they were discovered.
However, all things being equal, GPUs are far better suited for the task, because they contain thousands of specialized cores. Whereas a consumer GPU might have 16 or 32 cores, a data center GPU like the NVIDIA A100 has 6,912 CUDA cores. This enables it to process massive arrays of data simultaneously. Yet GPUs were missing an important puzzle piece: a GPU-specific algorithm.
That started taking shape in 2017, when software engineer Mihai Preda developed gpuOwl. This was before the GPU/data center hype, but Preda recognized that increasing floating-point performance and memory bandwidth of modern GPUs made them ideal for the heavy lifting required by GIMPS.
Using this algorithm, a data center in Dublin first flagged a new potential Mersenne prime (M136279841) in October 2024 using a method called the Fermat probable prime (PRP) test. The very next day, another data center in San Antonia confirmed it with the Lucas-Lehmer test.
These data centers were orchestrated by Luke Durant, a researcher and former NVIDIA engineer, whose “cloud supercomputer” spanned 24 regions across 17 countries, essentially creating a global virtual laboratory. This marks the first GIMPS prime discovered through a probabilistic test (the PRP is probabilistic, not deterministic) rather than a direct Lucas-Lehmer test.
This is all very impressive, but it all begs the question: Why go through all this trouble?
What This Does Not Mean for Cryptography
We often link large prime numbers to encryption. But the discovery of M136279841 does nothing to immediately strengthen digital encryption.
Modern cryptographic systems do use large primes, but these primes are still far smaller, usually ranging from 300 to 600 decimal digits. Using a number with 41 million digits would be wildly impractical due to the massive computational requirements. Furthermore, because the prime is publicly known, it would be an insecure choice for a secret key; the security of RSA relies on the difficulty of factoring a large number into two secret prime factors.
However, the search for increasingly large primes is essential for the future of cryptography for several theoretical and technical reasons.
The techniques used to find Mersenne primes (such as FFT-based multiplication) are the same techniques used in prime factorization. By pushing the boundaries of what is computationally possible with these algorithms, mathematicians gain a better understanding of the security margins of current encryption. The search pushes algorithms, benchmarks computational limits, and sharpens our sense of what large-number arithmetic can do.
This new Mersenne Prime also highlights a shift in the economic structure of prime hunting. Historically, GIMPS was a grassroots project where individual users donated their personal hardware and electricity. However, Luke Durant’s discovery was the result of a deliberate capital investment. Durant reportedly spent approximately $2 million of his personal wealth to rent cloud GPU capacity for the search, which lasted nearly exactly one year. GIMPS provides a $3,000 Research Discovery Award for new Mersenne primes, which Durant has indicated he will donate to the Alabama School of Math and Science. Larger prizes exist for major milestones, yet they remain small compared to the infrastructure costs of a large-scale search.
The hunt for ever-larger prime numbers serves as the high-stress test for the tools of our era. While the number itself will not be used to secure bank accounts today, the process of finding it may validate a new paradigm of GPU-driven discovery. Historically, it also represents a bridge between the 17th-century musings of a polymath monk and a 21st-century reality where the limits of mathematical knowledge are starting to be defined by silicon tools. Ultimately, though, perhaps we hunt these giant numbers because we are curious; not to add a line to a ledger, but to learn something new about the world. The number of primes is infinite, but so is our curiosity.
The post Mersenne Primes, GPUs, and a Number With 41 Million Digits originally appeared on the HLFF SciLogs blog.