28 balances. 30 overshoots.
Write out every divisor of 28 below 28 itself: 1, 2, 4, 7 and 14. Add them up.
The total matches the number, so 28 is perfect. Now try 30. Its proper divisors are 1, 2, 3, 5, 6, 10 and 15, which add to 42. The total overshoots by 12, so 30 is abundant. Try 25: 1 + 5 = 6, far short, so 25 is deficient.
Every whole number above 1 lands in one of those three bins. The total has a name, the aliquot sum, written s(n). Textbooks also use σ(n), the sum of all divisors with n included. A perfect number has σ(n) = 2n, which is why each result row on the Check tab shows the abundancy index σ(n)/n. Perfect numbers score exactly 2.000.
Three bins, nowhere near equal
Every prime, every power of a prime, and most odd numbers. A prime has one proper divisor, 1, so the sum never gets close.
6, 28, 496 and 8,128. After 8,128 the next one is 33,550,336, more than four thousand times larger.
12 is the first. Every multiple of 6 past 6 sits here, because a multiple of a perfect or abundant number inherits its divisors and gains more.
Widen the census to 1 through 1,000,000 and the split holds near three to one: 752,451 deficient, 247,545 abundant, and the same four perfect numbers. The abundant share settles around 24.76% as the range grows. Odd abundant numbers are the rare ones. The first is 945 (divisor sum 975), and the Scan tab names the first odd abundant number in any window you pick.
The 2p − 1 recipe
Euclid wrote the construction around 300 BC, in Book IX of the Elements. About two thousand years later Euler proved the converse: every even perfect number comes from this recipe and from nowhere else.
- Pick a prime exponent. Take p = 5.
- Compute 2p − 1 and test for primality. 25 − 1 = 31, a prime. Primes of this shape are called Mersenne primes.
- Multiply by 2p−1. 16 × 31 = 496. Its proper divisors add to 496.
Step two is where the recipe usually breaks. A prime exponent does not promise a prime result. p = 11 gives 2,047, and 2,047 = 23 × 89. The Build tab runs the Lucas-Lehmer test on 2p − 1, and when the test fails it searches for a factor of the form 2kp + 1, the only shape a factor of a Mersenne number with prime exponent takes. Both 23 and 89 fit: 23 = 2·1·11 + 1 and 89 = 2·4·11 + 1.
| p | Perfect number | Digits | First recorded |
|---|---|---|---|
| 2, 3, 5, 7 | 6, 28, 496, 8,128 | 1 to 4 | Listed by Nicomachus, around AD 100 |
| 13 | 33,550,336 | 8 | A German manuscript, around 1460 |
| 17, 19 | 8,589,869,056 and 137,438,691,328 | 10, 12 | Pietro Cataldi, 1588 |
| 31 | 2,305,843,008,139,952,128 | 19 | Leonhard Euler, 1772 |
| 127 | Too long for this column | 77 | Édouard Lucas, 1876 |
| 61 | Too long for this column | 37 | Ivan Pervushin, 1883 |
| 521 to 2,281 | Five numbers | 314 to 1,373 | Raphael Robinson on the SWAC computer, 1952 |
| 136,279,841 | The 52nd known | About 82 million | Luke Durant through GIMPS, October 2024 |
Order of discovery did not follow size. Lucas proved 2127 − 1 prime seven years before Pervushin settled the smaller 261 − 1, and Lucas's prime stayed the largest known prime for 75 years. Since Robinson, every new perfect number has come from a computer search. The Build tab takes exponents up to 5,000, which covers the first 20 Mersenne primes. Load p = 4423 and the page prints all 2,663 digits of the 20th perfect number.
Nobody has found an odd one
All 52 known perfect numbers are even. Nobody has proved odd ones impossible either. Descartes posed the question in a 1638 letter to Mersenne, and the answer is still missing. Decades of work have only fenced in where one would have to hide.
An odd perfect number, if one exists, has to:
- be larger than 101500 (Ochem and Rao, 2012)
- have at least 101 prime factors, counting repeats (same paper)
- have at least 10 different prime factors (Nielsen, 2015)
The Check tab puts the first bound to work. An odd entry above 1012 is too large to factor in a browser, but any odd number shorter than 1,501 digits still gets a firm not perfect from the bound alone. Even entries of any length up to 3,000 digits get an exact verdict from the Euclid-Euler form.
Fast tells for even perfect numbers
- Last digits. Always 6 or 28. 496 ends in 6, 8,128 ends in 28.
- Binary. p ones followed by p − 1 zeros. 28 is
11100, 496 is111110000. The Build tab prints this pattern for every result. - Triangular. 2p−1(2p − 1) equals 1 + 2 + 3 + … + (2p − 1). 28 is the sum of 1 through 7.
- Odd cubes. Past 6, each one is a sum of consecutive odd cubes from 1. 28 = 1³ + 3³, and 496 = 1³ + 3³ + 5³ + 7³.
- Digital root. Past 6, the digits collapse to 1. 8,128 gives 8 + 1 + 2 + 8 = 19, then 10, then 1.
Use these to throw out candidates, never to confirm one. 16 ends in 6, 10 is triangular, and neither is perfect.
Numbers that come close
| Number | s(n) | Why this one stands out |
|---|---|---|
| 1,024 | 1,023 | Every power of 2 falls short by exactly one. These are the almost perfect numbers. |
| 12 | 16 | The smallest abundant number. |
| 70 | 74 | Abundant, yet no subset of its divisors adds to 70. The smallest weird number. |
| 220 | 284 | Amicable with 284, whose proper divisors add back to 220. Load the 200 to 1,300 range to see two such pairs. |
| 945 | 975 | The smallest odd abundant number. |
| 2,047 | 113 | 211 − 1. Prime exponent, composite result, so the recipe produces nothing. |
The mirror image of an almost perfect number would overshoot by exactly one. Such numbers are called quasiperfect. None has been found, and any that exists must be an odd square above 1035.
Where this page stops
- Check tab
- Full divisor sums up to 1012, by trial division to the square root. Longer entries, up to 3,000 digits, get a perfect or not-perfect verdict but no abundant or deficient label, because splitting a 20-digit composite by trial division would freeze the page. 200 entries per run.
- Scan tab
- The window ends at 2,000,000. The fifth perfect number is 33,550,336, so no scan here shows more than four. For the fifth, use the Build tab with p = 13. CSV export covers windows up to 200,000 numbers.
- Build tab
- Exponents 2 to 5,000. Lucas-Lehmer at p = 4,423 takes a fraction of a second on a laptop, more on an older phone. The 21st Mersenne exponent, 9,689, sits outside the limit.
- Factor search
- When 2p − 1 fails, the page tries 2kp + 1 for k up to 50,000. Some Mersenne composites have no factor that small, and the result says so instead of guessing. 267 − 1 is the famous case: its smallest factor is 193,707,721, and Frank Nelson Cole presented it in 1903 by multiplying out the two factors on a blackboard without speaking.
This page answers one question per number: how do its divisors add up. For the full divisor table and factor pairs of a single number, the factor calculator lays them out better. To sort a list into primes and composites, use the prime number filter, and to turn the binary pattern of a perfect number back into decimal, the binary to decimal converter takes the string as is.