Math · Number theory
Perfect and amicable number checker.
Classify a whole number as perfect, abundant or deficient from the sum of its proper divisors, and check whether it has an amicable partner.
Inputs
Classification
Enter a whole number.
Perfect, abundant, deficient and amicable numbers
Add up the proper divisors of n, meaning every divisor except n itself. If the sum equals n, n is perfect. If the sum is larger, n is abundant; if smaller, deficient. The first perfect numbers are 6, 28, 496, 8,128 and 33,550,336 (OEIS A000396). 6 = 1 + 2 + 3 and 28 = 1 + 2 + 4 + 7 + 14. 12 is abundant (1 + 2 + 3 + 4 + 6 = 16) and 8 is deficient (1 + 2 + 4 = 7).
Amicable pairs. Two different numbers are amicable when each equals the sum of the other's proper divisors. The smallest pair is 220 and 284: the proper divisors of 220 add to 284, and those of 284 add to 220. The next pairs are 1,184 and 1,210, then 2,620 and 2,924 (OEIS A063990).
How it works. The tool factors the number, then uses the divisor-sum formula: for each prime power p^e multiply 1 + p + ... + p^e, then subtract n. By convention 1 has no proper divisors, so its sum is 0 and it is deficient.
Frequently asked questions
What is a perfect number?
A number equal to the sum of its proper divisors. 6 and 28 are the first two.
What are amicable numbers?
A pair of different numbers where each is the sum of the other's proper divisors, such as 220 and 284.
What is an abundant number?
A number whose proper divisors add to more than itself. 12 is the smallest, with a sum of 16.
What are the first five perfect numbers?
6, 28, 496, 8,128 and 33,550,336.
Is 1 perfect?
No. It has no proper divisors, so the sum is 0 and it is deficient.
Sources
Checked
Perfect and amicable lists are from the OEIS entries above and checked against them in the test suite; classification for 1 to 800 is also checked against brute-force divisor sums. Runs entirely in your browser. Nothing you type is sent or stored.
For learning
Numbers are classified exactly below 10^24. Very large numbers that are hard to factor may be refused.