Image: Rijksmuseum, Amsterdam (CC0)Perfect numbers and the hunt for an odd one
A perfect number is a positive integer that equals the sum of its divisors other than itself. The divisors of 6 other than 6 are 1, 2, and 3, and 1 + 2 + 3 = 6. For 28 they are 1, 2, 4, 7, and 14, which add to 28. The next two are 496 and 8128, and those four were the complete list known to the Greeks. The fifth, 33,550,336, appears in a manuscript of the fifteenth century. Today 52 are known, the largest has 82 million digits, and every one of them is even.
Euclid's recipe
The last proposition of Book IX of Euclid's Elements, IX.36, gives a construction. Add up the powers of two, 1 + 2 + 4 + ... + 2^(k-1) = 2^k - 1. If that sum is prime, then the sum multiplied by its last term, (2^k - 1) × 2^(k-1), is perfect. For k = 2 the sum is 3 and the number is 3 × 2 = 6. For k = 3 it is 7 × 4 = 28. For k = 5 it is 31 × 16 = 496, and for k = 7 it is 127 × 64 = 8128.
The proof is a short computation with the divisor sum. Write σ(n) for the sum of all divisors of n, including n itself, so that n is perfect exactly when σ(n) = 2n. The function σ is multiplicative: if a and b are coprime, σ(ab) = σ(a)σ(b), because every divisor of ab is a product of a divisor of a and a divisor of b in exactly one way. For a power of two, σ(2^(k-1)) = 1 + 2 + ... + 2^(k-1) = 2^k - 1. For a prime q, σ(q) = q + 1. So if q = 2^k - 1 is prime, σ(2^(k-1) q) = (2^k - 1)(2^k) = 2 × 2^(k-1) q, which is twice the number. That is all.
Primes of the form 2^k - 1 are called Mersenne primes, after Marin Mersenne, a French monk who in 1644 published a list of the exponents k up to 257 for which he believed 2^k - 1 to be prime. The list had five errors, two numbers that are composite and three primes he missed, and the last of them was not corrected until 1947. For 2^k - 1 to be prime, k must itself be prime, since 2^(ab) - 1 is divisible by 2^a - 1. The converse fails: 2^11 - 1 = 2047 = 23 × 89. The exponents that work begin 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, and the 52nd known is 136,279,841, found in October 2024.
Euler's converse
Euclid's recipe produces even perfect numbers. Two thousand years later Euler proved that it produces all of them: every even perfect number is of the form 2^(k-1)(2^k - 1) with 2^k - 1 prime. The proof was found among his papers after his death in 1783 and is short enough to give.
Let n be even and perfect, and write n = 2^(k-1) m with m odd and k at least 2. By multiplicativity, σ(n) = (2^k - 1) σ(m), and since n is perfect, σ(n) = 2n = 2^k m. So (2^k - 1) σ(m) = 2^k m. The factor 2^k - 1 is odd and divides 2^k m, hence divides m; write m = (2^k - 1) M. Substituting and cancelling gives σ(m) = 2^k M = m + M. But σ(m) is the sum of all divisors of m, and m and M are two of them, distinct since 2^k - 1 is greater than 1. If m had any other divisor the sum would exceed m + M. So m has exactly two divisors, m and M, which forces M = 1 and m prime. Then m = 2^k - 1 is a Mersenne prime and n is Euclid's number.
The theorem is usually called the Euclid-Euler theorem, and the two-thousand-year gap between its halves is the longest in the subject. Unit 6 of the masterclass proves both halves after developing σ and the other arithmetic functions.
Finding Mersenne primes
Because of the theorem, the search for even perfect numbers is the search for Mersenne primes, and that search has a special tool. The Lucas-Lehmer test, devised by Édouard Lucas in 1876 and put in its modern form by Derrick Henry Lehmer in 1930, decides whether 2^p - 1 is prime by computing a sequence: start with 4, and repeatedly square, subtract 2, and reduce modulo 2^p - 1. After p - 2 steps, the number 2^p - 1 is prime exactly when the result is 0. Lucas used the test, in a weaker form and by hand, to prove that 2^127 - 1, a 39-digit number, is prime; it stayed the largest known prime for 75 years. Since 1996 the Great Internet Mersenne Prime Search has run the test on volunteers' computers and found the last 18 Mersenne primes, the latest on a graphics processor. The article on that discovery gives the details.
Nobody knows whether there are infinitely many Mersenne primes, and so nobody knows whether there are infinitely many perfect numbers. Heuristics based on the prime number theorem suggest that the number of Mersenne prime exponents below x grows like a constant times ln x, which fits the data, but a heuristic is a guess with a formula attached.
The odd case
Whether an odd perfect number exists is the question Euler left open, and it is open still. What is known is a long list of conditions any such number N must satisfy, each proved by pushing the divisor sum harder. Euler himself showed that N must be of the form p^a m² with p a prime of the form 4k + 1 and a also of the form 4k + 1. Nielsen proved in 2007 that N has at least nine distinct prime factors; Ochem and Rao proved in 2012 that N has at least 101 prime factors counted with multiplicity and that N exceeds 10^1500. Goto and Ohno showed in 2008 that the largest prime factor exceeds 10^8. Each condition rules out a region, and the regions have not yet covered everything.
There is a reason to expect the answer to be no. Carl Pomerance has given a heuristic argument that the expected number of odd perfect numbers is finite and very small; the conditions above are so restrictive that a random integer of the right shape would almost never satisfy σ(N) = 2N exactly. But the same kind of heuristic says that there should be no odd number N with σ(N) = 2N + 1 either, and the problem of proving that is just as open. A heuristic tells you what to expect; it does not tell you what is true.
Near misses and relatives
Numbers for which σ(n) is less than 2n are called deficient and those with more are abundant; 12 is the smallest abundant number, since 1 + 2 + 3 + 4 + 6 = 16. The amicable pairs, such as 220 and 284, are pairs in which each number's proper divisors add up to the other; Pythagoras is said to have known this pair, and Euler found about sixty more. A sociable chain goes round in a longer cycle. Start from any number, replace it by the sum of its proper divisors, and repeat, and you get an aliquot sequence; whether every such sequence ends in 1, a perfect number, or a cycle, or whether some run off to infinity, is unknown even for the starting value 276, which has been followed for more than 2,000 steps without settling.
All of these are questions about the function σ, and the function is easy to compute from the factorization: if n = p₁^(e₁) ... p_r^(e_r), then σ(n) is the product of (p_i^(e_i + 1) - 1)/(p_i - 1). For 720 = 2⁴ × 3² × 5 that gives 31 × 13 × 6 = 2418. The formula is the first thing proved in Unit 6 of the masterclass, and the perfect numbers are where the unit ends.


