Understanding the divisors calculator — concept and principle
The divisors (or factors) of a whole number n are all the positive whole numbers that divide n with no remainder. This calculator lists them in order, counts them, adds them up, and classifies n as perfect, abundant or deficient. Divisor lists help with arranging items in equal rows, choosing group sizes, simplifying fractions and solving number puzzles.
How it is calculated
- For each i from 1 while i × i ≤ n, check whether n mod i = 0.
- If it does, both i and n ÷ i are divisors; when i × i = n the pair is a single divisor.
- Sort the list. Count is its length and Sum is σ(n), the total of all divisors including n itself.
- Compare the sum of the proper divisors, s(n) = σ(n) − n, with n: equal means perfect, larger means abundant, smaller means deficient.
Valid inputs are whole numbers from 1 to 10¹².
The principle
Divisors come in pairs i × (n ÷ i) = n, and in each pair one member is at most √n. So scanning up to √n finds every divisor while doing only about √n checks: for n = 10¹² that is a million steps instead of a trillion. The classification goes back to Greek mathematics, where a number was compared with the sum of its "parts". If n = p₁^e₁ × p₂^e₂ × …, the count is (e₁ + 1)(e₂ + 1)… which gives a quick check on the list length.
Worked example
- Input: 72. √72 ≈ 8.49, so test i = 1 to 8.
- Pairs found: 1 × 72, 2 × 36, 3 × 24, 4 × 18, 6 × 12, 8 × 9. (5 and 7 do not divide 72.)
- Sorted list: 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72; count 12. Check: 72 = 2³ × 3², so (3 + 1)(2 + 1) = 12.
- Sum: 195.
- Proper divisors sum to 195 − 72 = 123, which is greater than 72, so 72 is abundant.
| Number | Count |
|---|---|
| 18 | 6 |
| 36 | 9 |
| 54 | 8 |
| 72 | 12 |
| 90 | 12 |
| 108 | 12 |
| 144 | 15 |
How to read the result
An odd count means n is a perfect square, because its square root pairs with itself. Primes have exactly two divisors. Most numbers are deficient; the smallest abundant number is 12, and the only perfect numbers below 10,000 are 6, 28, 496 and 8128. A large count relative to size (such as 60, 72 or 360) makes a number easy to split into equal groups.
Common mistakes
- Forgetting 1 and n itself, which are always divisors.
- Stopping the search at a small number instead of √n and missing a pair.
- Confusing the sum of all divisors σ(n) with the sum of proper divisors used for the perfect/abundant test.
Frequently asked questions
Why does a square number have an odd number of divisors?
Divisors pair up as i and n ÷ i, but √n pairs with itself, leaving one unpaired divisor.
Are there odd perfect numbers?
None is known. Whether one exists is a famous open problem; every known perfect number is even.
Do negative numbers have divisors?
Yes, −2 divides 72 as well, but lists of divisors conventionally include only positive ones.
Sources: Euclid, Elements, Book VII, Definitions, and Book IX, Proposition 36 (even perfect numbers) · G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Chapter 16