A positive integer is perfect if it equals the sum of its proper divisors. The smallest perfect number is , whose proper divisors are , and . The next is . The third is , and the fourth is . These four were known to the ancient Greeks, who attached great mystical importance to them — Saint Augustine wrote that “God created the world in six days because six is a perfect number.”
After , the next perfect number is . The gap is enormous, and the search for perfect numbers turns out to be one of the oldest open computational projects in mathematics. The question is governed by a single beautiful theorem connecting perfect numbers to a special class of primes called Mersenne primes, and the modern hunt for new perfect numbers is, by way of this theorem, a hunt for new Mersenne primes. This article is about the history of that hunt, why the connection holds, and where things stand twenty-three centuries after Euclid first wrote about it.
The Euclid–Euler theorem
In Book IX of his Elements (around 300 BCE), Euclid proved that if is prime, then is perfect. The proof is short and accessible: factor the candidate, compute the sum of its divisors, and check.
This gives a recipe for making perfect numbers from primes of the form . With : (prime), so is perfect. With : (prime), so is perfect. With : (prime), so . With : (prime), so . The first four perfect numbers fall out of the first four primes for which is prime.
What Euclid could not prove is the converse — that every even perfect number must have this form. Twenty centuries later, Leonhard Euler did. In his 1747 Tractatus de numerorum doctrina, Euler proved the converse: any even perfect number can be written as with prime. Together, Euclid’s and Euler’s results give the Euclid–Euler theorem:
The even perfect numbers are exactly the numbers where is a prime.
This is a complete classification. Finding new even perfect numbers is equivalent to finding new primes of the form . The whole subject, for the past three centuries, has revolved around hunting for such primes.
Mersenne primes
The primes of the form are called Mersenne primes, after the French monk Marin Mersenne (1588–1648), who in 1644 conjectured a list of which exponents make prime. Mersenne’s list contained errors — both inclusions of composites and omissions of true Mersenne primes — but his name has stuck to this entire class of numbers.
A first observation: if is composite, say with , then is composite too, since divides . So for to be prime, itself must be prime. But the converse fails — not every prime gives a Mersenne prime. For example, is prime, but is composite.
So Mersenne primes are a thinning of the prime exponents: each prime is a candidate, but only some of them actually produce Mersenne primes. The known Mersenne-prime exponents (the first 12 of them) are:
After the ancient Greeks identified four perfect numbers, the next Mersenne prime () had to wait until the 15th century. The next two () were found by Pietro Cataldi in 1588. By the time computers entered the picture in the 1950s, only 12 Mersenne primes had been discovered in over two millennia of human computation. As of 2024, 52 Mersenne primes are known, the largest having more than million digits.
The Lucas–Lehmer test
The reason computer searches for Mersenne primes have been so successful is the existence of an efficient primality test specific to Mersenne numbers, the Lucas–Lehmer test (refined by Édouard Lucas in 1876, then by Derrick Henry Lehmer in 1930).
Define the sequence and . Then for an odd prime , the Mersenne number is prime if and only if .
The test takes modular squarings to run, which is fast even for huge . With around million, the test takes hours or days on a modern desktop — much faster than testing a random large number for primality, where no comparable shortcut exists. This is why nearly all of the largest known primes are Mersenne primes: there is a fast specialised test, and there is no fast equivalent for general numbers.
GIMPS: distributed computing for primes
Since 1996, the Great Internet Mersenne Prime Search (GIMPS), a volunteer distributed computing project, has been systematically testing Mersenne candidates. Volunteers download a client program that runs the Lucas–Lehmer test on assigned exponents and reports back. By December 2018, GIMPS had found 17 Mersenne primes, including the current largest known prime , which has decimal digits.
GIMPS offers monetary prizes for new Mersenne primes (currently three thousand dollars for any new find), and the Electronic Frontier Foundation has long-standing prizes for primes with 100 million and 1 billion digits — both still unclaimed.
Mersenne prime exponents become exponentially rarer as grows. A heuristic argument by Lenstra, Pomerance, and Wagstaff predicts that the count of Mersenne primes with exponent up to grows like for some constant . By the heuristic, we should expect a few new Mersenne primes per decade of search range, which is roughly what GIMPS has been observing.
Odd perfect numbers: the great open question
The Euclid–Euler theorem classifies even perfect numbers, but says nothing about odd ones. Are there any odd perfect numbers?
No one knows. None has ever been found. But no one has proved that none can exist, either. Modern research has accumulated a long list of constraints that any odd perfect number would have to satisfy:
- Larger than (Ochem and Rao, 2012).
- At least distinct prime factors, the largest of which must exceed (Goto and Ohno, 2008).
- The smallest prime factor must be at most about .
- The number must have at least prime factors counted with multiplicity.
- Many other tight constraints on its prime structure.
Each new constraint rules out a slightly larger class of potential odd perfect numbers, but none of them comes close to proving impossibility. Most number theorists believe odd perfect numbers do not exist, but the proof remains elusive after thousands of years of search.
Why the questions are deep
Perfect numbers and Mersenne primes might appear, on the surface, to be a recreational curiosity. The reason mathematicians take them seriously is what they encode about the multiplicative structure of the integers.
Perfect numbers are about the sum-of-divisors function : a number is perfect when . The function is multiplicative — when — and lives in the same family of “arithmetic functions” as the totient function . Understanding when requires understanding subtle multiplicative coincidences.
Mersenne primes are about the factorisation properties of numbers of a very specific form. They sit at the intersection of two large theoretical themes: the density of primes (how many Mersenne primes are there?) and the algebraic structure of cyclotomic extensions (the factorisation of ). Whether there are infinitely many Mersenne primes is a question about the asymptotic density of primes in a sparse sequence, and it remains far beyond the reach of current techniques.
A continuous thread
The hunt for perfect numbers is, perhaps, the longest continuously-pursued problem in mathematics. Pythagoras’s students were studying them in the 6th century BCE. Euclid wrote about them around 300 BCE. Mersenne, Fermat, Descartes, and Euler all worked on them. Lucas and Lehmer developed the modern primality test. Computers, beginning with Robinson’s ENIAC calculations in 1952, joined the search. GIMPS, since 1996, has distributed the search across hundreds of thousands of volunteer computers worldwide.
In the entire arc of this twenty-three-century pursuit, the basic question has not changed: which numbers of the form are prime, and (equivalently) what are the perfect numbers? Every mathematician who has worked on the problem has used progressively more sophisticated tools, but they have all been chasing the same simple-looking quantity. That is the hallmark of a problem at the right level of depth: easy to state, hard to settle, and connected to enough other parts of mathematics that progress at any one point teaches something about all of them. Perfect numbers and Mersenne primes are the prototype.
The next Mersenne prime might be found by GIMPS this year, or in five years, or in fifty. Whoever finds it — likely a volunteer running a free program on a personal computer — will be the latest link in a chain of inquirers stretching back to Euclid. Few mathematical traditions span so many centuries with such an unbroken continuity. Perfect numbers connect us, in a small but real way, to the very beginnings of the mathematical project.
Frequently asked
What is a perfect number, exactly?
A positive integer n is perfect if it equals the sum of its proper positive divisors — that is, all positive divisors of n except n itself. The first few perfect numbers are 6 (= 1 + 2 + 3), 28 (= 1 + 2 + 4 + 7 + 14), 496, 8128, 33550336, and 8589869056. The sequence grows quickly: only 52 perfect numbers are known as of 2024. The ancient Greeks knew the first four; the fifth was found in the 15th century; and modern numbers have been discovered using distributed computing.
What is the Euclid–Euler theorem?
It says that every even perfect number has the form 2^(p−1)(2^p − 1), where 2^p − 1 is a prime number. Euclid proved in around 300 BCE that any number of this form is perfect (provided 2^p − 1 is prime); Euler proved in 1747 that every even perfect number must have this form. The theorem completely classifies even perfect numbers: they are in bijection with Mersenne primes.
What is a Mersenne prime?
A Mersenne prime is a prime number of the form 2^p − 1, where p is itself prime. (It's not always the case that 2^p − 1 is prime when p is; for example, 2^11 − 1 = 23 × 89 is not prime.) Named after the French monk Marin Mersenne (1588–1648), who studied them. The largest known prime as of 2024 — 2^82,589,933 − 1 — is a Mersenne prime with more than 24 million decimal digits, found in 2018 by the Great Internet Mersenne Prime Search (GIMPS), a volunteer distributed-computing project.
Are there infinitely many Mersenne primes, or any odd perfect numbers?
Both are major unsolved problems. It is conjectured but not proved that infinitely many Mersenne primes exist; the heuristic estimates predict the count of Mersenne primes among the first N exponents grows logarithmically. As for odd perfect numbers, none has ever been found, and any that exists must be larger than 10^1500 and satisfy many other extreme constraints proved over the past century. Most number theorists believe odd perfect numbers do not exist, but a proof has never been produced. These two questions are arguably the oldest open problems in mathematics, both dating back to Euclid.