Semiperfect Number Calculator
Number
- A semiperfect (or pseudoperfect) number equals the sum of a subset of its proper divisors - all of them in the case of a perfect number.
- The proper divisors of 12 are 1, 2, 3, 4, 6, with an aliquot sum of 16.
- A subset-sum search finds 1 + 2 + 3 + 6 = 12.
- So 12 is semiperfect.
A semiperfect number, also called a pseudoperfect number, is a number that equals the sum of a subset of its proper divisors. A perfect number is the special case where the subset is all of the proper divisors. This calculator takes a number you enter and tells you whether it is semiperfect, showing the subset of proper divisors that adds up to it when one exists. The smallest semiperfect number is 12: its proper divisors are 1, 2, 3, 4 and 6, and 1 + 2 + 3 + 6 = 12 (6 + 4 + 2 also works). 20 is semiperfect too, since 10 + 5 + 4 + 1 = 20 from its proper divisors 1, 2, 4, 5 and 10. Not every abundant number qualifies: 70 is abundant because its proper divisors sum to 74, but no subset of them sums to 70, which makes 70 the smallest weird number. A deficient number, whose proper divisors sum to less than the number itself, can never be semiperfect.
The method behind the answer is subset-sum checking over the proper divisors, the accepted standard for deciding semiperfect numbers: a number is semiperfect exactly when some subset of its proper divisors sums to it. Two facts follow directly from that definition and help you read the result. Every multiple of a semiperfect number is semiperfect, and every practical number is semiperfect. This page shows the formula, the step-by-step workings, worked examples and sources, so you can follow each calculation rather than take the result on trust.
Worked examples
12, the smallest semiperfect number
(12)
| Is 12 a semiperfect number? | Yes - a subset of its proper divisors sums to 12 |
| Proper divisors | 1, 2, 3, 4, 6 |
| Aliquot sum of proper divisors | 16 |
| Subset summing to 12 | 1 + 2 + 3 + 6 |
20 = 10 + 5 + 4 + 1
(20)
| Is 20 a semiperfect number? | Yes - a subset of its proper divisors sums to 20 |
| Proper divisors | 1, 2, 4, 5, 10 |
| Aliquot sum of proper divisors | 22 |
| Subset summing to 20 | 1 + 4 + 5 + 10 |
70, the smallest weird number
(70)
| Is 70 a semiperfect number? | No - it is abundant (aliquot sum 74) but no subset of its proper divisors sums to 70: a weird number |
| Proper divisors | 1, 2, 5, 7, 10, 14, 35 |
| Aliquot sum of proper divisors | 74 |
| Subset summing to 70 | No subset exists |
What is a semiperfect number?
A semiperfect number — also called a pseudoperfect number — is a positive integer that equals the sum of a subset of its proper divisors. Proper divisors are the positive divisors of a number other than the number itself. The key word is subset: you do not have to use every proper divisor, only some of them, and each one at most once. When the subset happens to be all of the proper divisors, you get a perfect number, so every perfect number is semiperfect as a special case. The semiperfect number is therefore the broader category, and perfect numbers sit inside it.
The smallest example is 12. Its proper divisors are 1, 2, 3, 4, and 6, and the subset 1 + 2 + 3 + 6 adds up to exactly 12. Another subset works too: 6 + 4 + 2 = 12. One valid subset is enough. The next familiar case is 20, whose proper divisors are 1, 2, 4, 5, and 10; the subset 10 + 5 + 4 + 1 sums to 20.
Not every abundant number qualifies. An abundant number is one whose proper divisors sum to more than the number itself, but that surplus does not guarantee a subset hitting the target exactly. The classic counterexample is 70: its proper divisors sum to 74, so it is abundant, yet no subset of those divisors adds up to 70. That makes 70 the smallest weird number — abundant without being semiperfect. At the other end, a deficient number, whose proper divisors sum to less than the number, can never be semiperfect, because no subset of its divisors can reach a total larger than that sum.
Two rules help you generate and recognize these numbers quickly. Every multiple of a semiperfect number is semiperfect, so once you have one example you get an infinite family of them. Also, every practical number is semiperfect; practical numbers are those whose divisors can represent every smaller positive integer as a subset sum, which is a stronger condition than the single subset a semiperfect number needs.
To test a number by hand, list its proper divisors, then check whether any combination of them totals the number. For small inputs the subsets are few enough to try directly; for larger inputs the list of divisors grows and the combinations multiply, which is where a calculator saves time.
- 12 is the smallest semiperfect number: 1 + 2 + 3 + 6 = 12, and 6 + 4 + 2 = 12 also works.
- 20 is semiperfect: 10 + 5 + 4 + 1 = 20.
- 70 is abundant but not semiperfect, making it the smallest weird number.
- Every multiple of a semiperfect number is semiperfect.
- Every practical number is semiperfect.
- A deficient number can never be semiperfect.
How the subset search works
To decide whether a number is semiperfect, the calculator follows a fixed sequence: list the proper divisors, add them to get the aliquot sum, then search for a subset that hits the target. Proper divisors are the positive divisors smaller than the number itself; for 12 they are 1, 2, 3, 4 and 6, and for 20 they are 1, 2, 4, 5 and 10. The aliquot sum is simply the total of that list. If the sum falls short of the number, the search stops immediately: a deficient number can never be semiperfect, because even taking every proper divisor cannot reach the target.
The subset-sum step is where the real work happens. Every combination of proper divisors is tested to see whether it adds up exactly to the number. Take 12, the smallest semiperfect number. Its proper divisors include the subset 1 + 2 + 3 + 6 = 12, and another valid subset is 6 + 4 + 2. Finding one such subset is enough to confirm that 12 is semiperfect. The same check on 20 succeeds with 10 + 5 + 4 + 1 = 20, drawn from its proper divisors 1, 2, 4, 5 and 10.
A generous aliquot sum does not guarantee success. The number 70 is abundant, since its proper divisors sum to 74, yet no subset of those divisors sums to 70. That failure makes 70 the smallest weird number. The calculator's search therefore cannot rely on the aliquot sum alone; it has to test combinations until one matches or the possibilities are exhausted. A perfect number is the special case where the winning subset is all of the proper divisors.
Two shortcuts can settle some cases before any search begins. Every multiple of a semiperfect number is semiperfect, and every practical number is semiperfect. A number whose proper divisors sum to less than the number is deficient and can never qualify. For everything else, the subset search is the deciding test, and a single matching subset is all it takes to classify the number as semiperfect.
Semiperfect, perfect, abundant, deficient and weird
Divisor sums sort whole numbers into a few families, and the semiperfect numbers sit in an unusual spot among them. The table below sets the classes side by side, with one example of each, so you can see how a single number can belong to one group and narrowly miss another.
The dividing line is what you do with the proper divisors — the divisors smaller than the number itself. If some subset of them adds up to the number, it is semiperfect (also called pseudoperfect). A perfect number is the special case where the subset is all of the proper divisors at once. A deficient number has proper divisors that sum to less than the number, so no subset can ever reach it: a number whose proper divisors sum to less than the number can never be semiperfect. That rules out the deficient column entirely.
The abundant column is where things get interesting. Abundance — proper divisors summing to more than the number — is necessary for a number to be semiperfect, but it is not sufficient. The smallest weird number proves the point: 70 is abundant, since its proper divisors sum to 74, yet no subset of those divisors sums to 70. That gap between having enough and being able to hit the target exactly is what makes 70 weird, and it is why weird numbers are abundant but not semiperfect.
Concrete examples make the subset idea easier to see. Twelve is the smallest semiperfect number: its proper divisors 1, 2, 3, 4 and 6 include the subset 1 + 2 + 3 + 6 = 12, and 6 + 4 + 2 works too. Twenty is semiperfect as well, because 10 + 5 + 4 + 1 = 20 from its proper divisors 1, 2, 4, 5 and 10. Two structural facts follow from the definition: every multiple of a semiperfect number is semiperfect, and every practical number is semiperfect.
| Class | Rule for proper divisors | Example | Why |
|---|---|---|---|
| Perfect | Sum equals the number, using all proper divisors | 6 | The subset is every proper divisor |
| Semiperfect | Some subset sums to the number | 12 | 1 + 2 + 3 + 6 = 12 (also 6 + 4 + 2) |
| Abundant but not semiperfect (weird) | Sum exceeds the number, but no subset hits it | 70 | Proper divisors sum to 74; no subset sums to 70 |
| Deficient | Sum is less than the number | 8 | No subset can reach the number, so never semiperfect |
Why semiperfect numbers matter
The definition of a semiperfect number looks narrow, but the idea reaches into several corners of number theory. A semiperfect (pseudoperfect) number equals the sum of a subset of its proper divisors, and a perfect number is the special case where that subset is all of them. That single change — any subset rather than the whole set — turns a rare curiosity into a broad family, and it links divisor combinatorics to subset-sum problems of the kind studied in computer science.
One reason the family is so broad is closure under multiplication. Every multiple of a semiperfect number is semiperfect. Once 12 qualifies — its proper divisors 1, 2, 3, 4, 6 include the subset 1 + 2 + 3 + 6 = 12 (also 6 + 4 + 2) — so do 24, 36, 48 and onward, because scaling the whole set of divisors scales the subset sum with it. The same logic carries 20, which works through 10 + 5 + 4 + 1 = 20 from its proper divisors 1, 2, 4, 5, 10, to all of its multiples. Every practical number is semiperfect as well, so the supply never runs dry.
The family is not confined to even numbers. Odd semiperfect numbers exist too, so parity is not the dividing line — the subset condition is. That matters because abundance alone does not decide membership. 70 is not semiperfect even though it is abundant: its proper divisors sum to 74, yet no subset of them sums to 70, which makes 70 the smallest weird number. On the other side, a number whose proper divisors sum to less than the number — deficient — can never be semiperfect, since no subset can exceed the total it draws from.
This is where the connection to subset-sum problems becomes concrete. Deciding whether a number is semiperfect means asking whether some selection of its proper divisors hits the target exactly, which is the subset-sum question in miniature, with the divisors as the available items and the number itself as the target. Abundant numbers like 70 show that a large enough pool of divisors does not guarantee a solution; the arithmetic structure of the divisors, not just their total, decides the outcome.
Together these notes explain why the semiperfect number concept earns attention beyond its definition: it sits where divisor structure meets a classic combinatorial search, and its closure under multiples and its odd members keep the question interesting at every scale.
FAQs
What is a semiperfect number?
A semiperfect number equals the sum of a subset of its proper divisors. The proper divisors are the positive divisors smaller than the number itself. For example, 12 is semiperfect because 12 = 6 + 4 + 2, and 6, 4 and 2 are all proper divisors of 12. The subset does not have to include every divisor.
Is 12 a semiperfect number?
Yes. 12 is the smallest semiperfect number. More than one subset of its proper divisors adds up to 12: 6 + 4 + 2 works, and 1 + 2 + 3 + 6 also works. Because at least one such subset exists, 12 meets the definition of a semiperfect number.
Is 70 a semiperfect number?
No. 70 is abundant, since its proper divisors sum to 74, which is more than 70. But no subset of those proper divisors sums to exactly 70. Because it is abundant yet not semiperfect, 70 is the smallest weird number.
Is every perfect number semiperfect?
Yes. A perfect number equals the sum of all of its proper divisors. All of its proper divisors form a subset of its proper divisors, so that subset already sums to the number. That means every perfect number is semiperfect by definition, with no extra conditions needed.
Can a deficient number be semiperfect?
No. A deficient number is one whose proper divisors sum to less than the number itself. If the total of all the proper divisors is already below the number, then no subset of them can reach the number. So a deficient number can never be semiperfect.
What is a weird number?
A weird number is abundant but not semiperfect. Its proper divisors sum to more than the number, yet no subset of those divisors sums to the number itself. 70 is the smallest weird number: its proper divisors sum to 74, but no subset of them adds up to 70.