In the Pursuit of Perfect

Sophie Maclean

There is a common philosophical debate as to whether mathematics is created or discovered. Those arguing that maths is discovered argue that the intrinsic beauty of mathematics cannot have come about by chance – the fact that the same numbers and ideas crop up again and again (I’m looking at you \(\pi\)) is beyond coincidence.

Those on “Team Created” will counter that the maths of today – Fourier analysis, algebraic geometry, even statistics – is so convoluted and abstract that it cannot possibly be innate to the universe. They point to the fact that some mathematical objects do not exist in nature, and so must solely be a creation of the human mind.

But “Team Discovered” have a trump card to play. There are a set of numbers that seem intrinsic to the world, so linked to other important sequences, that they seem to hold an almost spiritual significance. These numbers are those whose proper divisors (i.e. all the positive divisors excluding itself) sum to the original number. These are the aptly named Perfect Numbers.

Perfect Numbers

A more formal and more useful way to define perfect numbers is via the divisor sum function \(\sigma(n)\), which sums all of the positive divisors of \(n\) including \(n\). We then define a perfect number to be any number for which

\( \sigma(n) = 2n\) or, alternatively \( \frac{\sigma(n)}n = 2\).

There are, as you might expect, names for numbers for which \(\sigma(n) > 2n\) (abundant) and \(\sigma(n) <2n\) (deficient). In fact, there is a whole family of names for numbers depending on the properties of \(\sigma(n)\), but that’s a blog post for another time.

The first few perfect numbers are 6, 28, 496, and 8128. These have been known about for so long that we have no record of when they were first calculated. The earliest recorded result about perfect numbers was published in Euclid’s famous Elements, in circa 300BC.  We have, unsurprisingly, found bigger perfect numbers but it may come as a shock to learn that we have, at time of writing, only discovered 52.

Eagle-eyed readers may notice that every perfect number I have listed is even. In fact, every perfect number that has been discovered to date is even. It is unknown if any odd perfect numbers exist – after all, not finding any is not proof that there are none.

Those who are especially observant, and have an encyclopaedic knowledge of mathematical records, may have also spotted that the number of known perfect numbers, 52, matches exactly up with the number of known Mersenne prime numbers. This is not a coincidence, and we can prove why.

Even Perfect Numbers \(\leftrightarrow\) Mersenne Primes

Mersenne numbers are numbers of the form \(q = 2^p -1\) for some prime number \(p\). A Mersenne number that is prime is known (predictably) as a Mersenne prime. Even perfect numbers are in a one-to-one correspondence with Mersenne primes. In fact, we can do better than that and give the explicit relation:

 \(q = 2^p -1\) is a Mersenne prime if and only if \(n = 2^{p-1} (2^p -1)\) is a perfect number.

The proof of this is attributed to two mathematical greats with easily confused names: Euclid and Euler.

In around 300BC, Euclid proved one direction of the theorem, namely that

If \(q = 2^p -1\) is a Mersenne, then \(n = 2^{p-1} (2^p -1)\) is a perfect number.

It was then over 2000 years until, in the 18th century, that Euler proved the other direction, i.e. that

\(q = 2^p -1\) is a Mersenne prime if \(n = 2^{p-1} (2^p -1)\) is a perfect number.

Both of these proofs rely on the fact that \(\sigma\) is what is known as a multiplicative function. This means that if \(a\) and \(b\) share no prime factors (i.e. they are coprime) then \(\sigma(ab) = \sigma(a)\sigma(b)\).

Euler’s Proof

Portrait of Leonhard Euler.
Portrait of Leonhard Euler Image credits: public domain

Euler’s proof of statement (1) starts with \(2^p-1\) being prime and aims to show that \(n = 2^{p-1} (2^p -1)\) is perfect.

Using multiplicativity, \(\sigma(2^{p-1} (2^p -1)) = \sigma(2^{p-1})\sigma(2^{p-1)} \).

We can consider these parts separately. Since \(2^p-1\) is prime, its only positive factors are 1 and itself. Therefore \(\sigma(2^p-1) = (2^p-1) + 1 = 2^p\).

Now let us turn our attention to \(2^{p-1}\). Its factors are \(1, 2, 4, 8, \dots, 2^{p-1}\). We can sum this geometric series to get that \(\sigma(2^{p-1}) = 2^p-1\).

Putting all this together, for \( n =2^{p-1} (2^p -1)\), \(\sigma(n) = \sigma(2^{p-1})\sigma(2^p-1) = 2^p \cdot (2^p-1) = 2 ( 2^{p-1}(2^p-1)) = 2n\). Therefore \(n\) is perfect! 

Euclid’s Proof

Statue of Euclid. He holds a scroll on which there is a drawing of Pythagoras Theorem
20th Century Statue of Euclid. Image credits: public domain

As you may have guessed by the 2000-year gap, Euclid’s proof is a bit more complicated, but it still uses very elementary methods and goes a little deeper than the fact that \(\sigma\) is multiplicative.

Euclid begins with an even perfect number. Let us call this number \(n\) and write it as \(n =  2^k\cdot x\), where \(x\) is an odd number, and \(k\) is a positive integer. 

Because \(n\) is perfect, \(2n=\sigma(n)\) i.e. \(2^{k+1}x=\sigma(2^kx)\). By multiplicativity, \(2^{k+1}x =\sigma(2^k)\sigma(x)\). Just as above, we know that \(\sigma(2^k) = 2^{k+1} -1\), which is coprime to \(2^{k+1}\). We therefore have that \( 2^{k+1}\frac{x}{2^{k+1} -1}= \sigma(x)\).

Returning to that \(2^{k+1}x=\sigma(2^k)\sigma(x)\), this coprimality means that \(2^{k+1} -1\) must divide \(x\), and so too must \(\frac{x}{2^{k+1} -1}\). We know that \(x\) is a factor of itself too, so \(\sigma(x) = x + \frac{x}{2^{k+1} -1} + \text{ “other divisors” }= \frac{2^{k+1}}{2^{k+1} -1}\).

But this must mean there are no other divisors, as we know from before that \( 2^{k+1}\frac{x}{2^{k+1} -1}= \sigma(x)\). Therefore \(x\) only has two divisors: itself and \(\frac{x}{2^{k+1} -1}\). So it must be prime! What’s more, \(1\) is a factor of all numbers so we must have that \(\frac{x}{2^{k+1} -1} = 1\), i.e. \(x =2^{k+1} -1\).

It is known that for any prime number of the form \(2^q-1\), \(q\) has to be prime, so this is indeed a Mersenne prime, as opposed to a bog-standard, garden variety prime. And so, this completes the proof – Mersenne primes and even perfect numbers are in a one-to-one correspondence.

Examples

As is natural, I am sure you are wondering which primes correspond to the first four perfect numbers. 

Well, \(6 = 2 \times 3\), so in the above Euler proof, \(k=1\) and \(x=3\). So \(3\) is our Mersenne prime.

\(28 = 4 \times 7\), so in the above Euler proof, \(k=2\) and \(x=7\). So \(7\) is our Mersenne prime.

\(496 = 16 \times 31\), so \(31\) is our corresponding Mersenne prime. And \(8128= 64 \times 127\), giving the corresponding Mersenne prime of \(127\).

Thankfully these are exactly the first four Mersenne primes, as expected! Bigger and bigger Mersenne primes are being found via the Giant Internet Mersenne Prime Search, with the largest being found in 2024. Perfect numbers are then being calculated from these. But there was a gap of 6 years until the 2024 prime was found, so there may be a while to wait yet before a new perfect number comes along. 

Nature’s mystery

It is not even known if there are infinitely many Mersenne prime numbers, so not only do we not know if there is an odd perfect number to be found, but we also do not know if there are any more even perfect numbers. It is in part this mystery that has led mathematicians to be fascinated by perfect numbers for so long. And the deep links to prime numbers lead some to believe that maths is discovered after all.

To Pythagoras, perfect numbers didn’t just hint at some natural secret, they were deeply spiritual and holy in themselves. Philo of Alexandria even suggested that the world was created in 6 days because 6 is a perfect number. And that the lunar month is 28 days because that is another perfect number. 

Whatever you believe, I think we can all agree that perfect numbers are rather special indeed.

The post In the Pursuit of Perfect originally appeared on the HLFF SciLogs blog.