Superperfect Number Checker
Number Theory
- A superperfect number applies the divisor-sum function twice: n is superperfect when sigma of sigma(n) equals exactly 2n - one level stricter than a perfect number, which needs only sigma(n) = 2n.
- For 16: sigma(16) = 31, and applying sigma again gives sigma(31) = 32.
- The target is 2n = 32, so 16 is yes - superperfect number.
- Every known superperfect number is even and tied to a Mersenne prime: n = 2^(p-1) works exactly when 2^p - 1 is prime, and whether any odd superperfect number exists is unknown.
A superperfect number is what you get when the perfect-number condition is applied one level up: instead of requiring sigma(n) = 2n, it requires sigma(sigma(n)) = 2n - the divisor-sum function composed with itself. The smallest example is 2, and the family runs 2, 4, 16, 64, 4,096, 65,536, 262,144.
This superperfect number checker computes both sigma layers and compares the result with 2n, and its list mode sweeps a range exhaustively: up to 100,000 it finds exactly 2, 4, 16, 64, 4,096 and 65,536. The worked example 16 shows the mechanism at its cleanest - sigma(16) = 31, and sigma(31) = 32 = 2 x 16.
The family has a rigid structure. Every known superperfect number is even and of the form 2^(p-1) with 2^p - 1 a Mersenne prime, so the family grows exactly as fast as the Mersenne primes do. Whether any odd superperfect number exists is an open problem.
Worked examples
Is 16 superperfect?
(Test a number · 16)
| Superperfect test for 16 | yes - superperfect number |
| sigma(n) | 31 |
| sigma of sigma(n) | 32 |
| 2n for comparison | 32 |
Is 36 superperfect?
(Test a number · 36)
| Superperfect test for 36 | no |
| sigma(n) | 91 |
| sigma of sigma(n) | 112 |
| 2n for comparison | 72 |
Superperfect numbers up to 100,000
(List up to n · 100000)
| Superperfect numbers up to 100,000 | 2, 4, 16, 64, 4,096, 65,536 |
| count | 6 |
| largest | 65,536 |
| all known examples | even, and built from Mersenne primes |
Sigma applied twice
The definition is a two-step computation. First apply sigma: for 16, the divisors 1, 2, 4, 8, 16 sum to sigma(16) = 31. Then apply sigma again to that result: 31 is prime, so sigma(31) = 32. The test is whether the second value equals 2n = 32 - it does, so 16 is superperfect.
Contrast 36: sigma(36) = 91, and sigma(91) = 112, but 2 x 36 = 72. The chain misses, so 36 is not superperfect. The checker shows both sigma values and the 2n target for every test, so the size of a miss is visible rather than hidden behind a bare no.
- 16: sigma = 31, sigma again = 32 = 2n
- 36: sigma = 91, sigma again = 112, not 72
- Both layers and the target are shown
The Mersenne prime connection
Take n = 2^(p-1). Then sigma(n) = 2^p - 1. If that number is a Mersenne prime, sigma of it is 2^p = 2n, and n is superperfect. Conversely, the even superperfect numbers are known to arise exactly this way - the family is a shadow of the Mersenne prime family, one step removed.
Read the list through that lens: 2 = 2^1 (from the prime 3), 4 = 2^2 (from 7), 16 = 2^4 (from 31), 64 = 2^6 (from 127), 4,096 = 2^12 (from 8,191), 65,536 = 2^16 (from 131,071) and 262,144 = 2^18 (from 524,287). Each superperfect number certifies a Mersenne prime one exponent up.
- n = 2^(p-1) works exactly when 2^p - 1 is prime
- 65,536 corresponds to the Mersenne prime 131,071
- Even superperfect numbers all arise this way
Superperfect vs perfect
A perfect number satisfies sigma(n) = 2n in one application. A superperfect number asks the composed map to land on 2n instead. The two families are distinct: 6 and 28 are perfect but not superperfect, and 2 and 4 are superperfect but not perfect. Neither contains the other.
There is a family resemblance in the open problems, though. Just as odd perfect numbers are unknown, odd superperfect numbers are unknown - and for superperfect numbers the even case is completely solved by the Mersenne correspondence, which makes the odd case the whole mystery.
- Perfect: sigma(n) = 2n; superperfect: sigma(sigma(n)) = 2n
- 6 is perfect, not superperfect; 16 is superperfect, not perfect
- The even case is solved; the odd case is the mystery
How the check works
Sigma is computed from the prime factorisation by the standard product formula, applied twice. All arithmetic is exact integer arithmetic, and list mode simply repeats the test - up to 300,000 it returns the seven values 2, 4, 16, 64, 4,096, 65,536 and 262,144, matching the Mersenne-based construction exactly.
That agreement is the verification story: an exhaustive sweep and a constructive theorem produce the same list. When a brute-force check and a structural characterisation coincide, both are almost certainly right.
- Sigma twice, from the factorisation, exactly
- Sweep to 300,000: 2, 4, 16, 64, 4,096, 65,536, 262,144
- Sweep and Mersenne construction agree
The first values by hand
The smallest superperfect numbers can be verified with nothing but divisor lists. For 2: sigma(2) = 3 and sigma(3) = 4 = 2 x 2. For 4: sigma(4) = 7 and sigma(7) = 8 = 2 x 4. In both cases the first sigma lands on a prime - 3 and 7 respectively - and a prime's sigma is just itself plus one, which is exactly the doubling the definition wants.
That pattern is the Mersenne mechanism in miniature. When n = 2^(p-1), sigma(n) = 2^p - 1; whenever that is prime, the second sigma is forced to be 2^p = 2n. The hand checks for 2 and 4 are the cases p = 2 and p = 3 of the same argument that produces 65,536 from the prime 131,071.
- 2: sigma 3, then 4 - works
- 4: sigma 7, then 8 - works
- First sigma landing on a prime is the whole trick
How rare are they?
Up to 300,000 there are seven superperfect numbers, and the count grows only when a new Mersenne prime exponent appears in range. Since Mersenne primes themselves are sparse - and each one must be hunted with serious computation - the superperfect family inherits their scarcity wholesale.
That inheritance cuts both ways. Any future Mersenne prime 2^p - 1 immediately certifies 2^(p-1) as superperfect, so the family's frontier advances exactly when the Mersenne frontier does. A checker like this one, sweeping exhaustively to 300,000, maps the part of the frontier that brute force can see.
- Seven examples up to 300,000
- New Mersenne primes extend the family automatically
- Exhaustive sweep and construction cover the same ground
Testing the neighbours
The list's rigidity becomes vivid when you test the integers around a member. Around 16, the candidates 15, 17 and 18 all fail: their first sigma values do not land on numbers whose sigma doubles the input. The checker shows the two sigma values for each, and the misses are not close - the composed map sigma(sigma(n)) jumps around irregularly, landing on 2n only at the Mersenne-driven points.
That irregularity is the honest picture of the family. Between 64 and 4,096 there is nothing, and between 4,096 and 65,536 there is nothing, not because the sweep is lazy but because the Mersenne exponents themselves have gaps there. Testing neighbours is the quickest way to feel how completely the Mersenne primes dictate this family's shape.
- Neighbours of members fail by wide margins
- Gaps in the list mirror gaps in Mersenne exponents
- The composed sigma map is irregular except at the driven points
What would an odd example need?
Suppose an odd superperfect number exists. Its sigma is even - sigma of an odd number is even unless the number is a square, and the parity bookkeeping forces a tight shape: sigma(n) must be an even number whose own sigma is exactly 2n, with n odd. Researchers have converted those constraints into lower bounds: any odd superperfect number must be large, with a tightly constrained factorisation, which is why searches keep pushing the frontier without success.
For the calculator's range the question is settled by exhaustion: the sweep to 300,000 finds only the seven even, Mersenne-driven values. The odd case is a reminder that an elementary two-line definition can hide a research problem - the same phenomenon as the odd perfect numbers, one composition deeper.
- Odd example would need a tightly constrained shape
- Searches push bounds; none found
- Settled by exhaustion within the calculator's range
Open problems
The odd case is the open problem: no odd superperfect number is known, and no proof excludes one. An odd example would need sigma(n) to be an even number whose own sigma is exactly twice n - a tight pair of conditions that searches have pushed to large bounds without success.
The even family, meanwhile, inherits the Mersenne prime problem wholesale: there are infinitely many superperfect numbers if and only if there are infinitely many Mersenne primes, which is itself one of the oldest open questions in the subject.
- Odd superperfect numbers: existence unknown
- Infinitely many even ones iff infinitely many Mersenne primes
- Both directions of the even theory are settled
FAQs
What is a superperfect number?
An n with sigma(sigma(n)) = 2n - the divisor-sum function applied twice lands on twice the number.
Is 16 superperfect?
Yes - sigma(16) = 31 and sigma(31) = 32 = 2 x 16.
What are the superperfect numbers?
Up to 100,000: 2, 4, 16, 64, 4,096 and 65,536; the next is 262,144.
Is 36 superperfect?
No - sigma(sigma(36)) = sigma(91) = 112, not 72.
Why do Mersenne primes appear?
n = 2^(p-1) is superperfect exactly when 2^p - 1 is a Mersenne prime, because then sigma(n) = 2^p - 1 is prime and sigma of it is 2^p = 2n.
Are there odd superperfect numbers?
None are known, and existence is an open problem.