Divisors, factors and the pairing that halves the work
A divisor of n is a whole number that divides it leaving no remainder. Factor and divisor mean the same thing here; the words differ only in emphasis, with “factor” suggesting the multiplication that builds n and “divisor” the division that tests it.
Divisors come in pairs. If a divides n, then b = n/a is a whole number and divides n too, and the pair multiplies back to n. That observation is worth more than it looks. In each pair, one member is at most √n and the other is at least √n — if both were larger than the square root their product would exceed n. So to find every divisor you only need to test candidates up to √n and read off each partner by division. For n = 360 that means testing 18 candidates rather than 360, and for a twelve-digit number it means a million tests rather than a trillion.
Only a perfect square has a divisor that pairs with itself: 36 pairs 6 with 6. That is why perfect squares are the only numbers with an odd divisor count, a fact with a well-known consequence — the locker problem, in which each locker is toggled once per divisor, leaves exactly the square-numbered lockers open.
Two divisors are guaranteed for every n greater than 1: the number 1 and n itself. These are called improper or trivial divisors. A number whose only divisors are those two is prime, which is why the divisor count of a prime is exactly 2 and why the prime checker is really asking the same question this calculator answers.
Counting and summing the divisors without listing them
Listing divisors by trial division is fine for small numbers and hopeless for large ones. The efficient route goes through the prime factorisation, and it produces both the count and the sum directly.
Write n as a product of prime powers, say 360 = 2³ × 3² × 5¹. Every divisor of n is built by choosing an exponent for each prime, independently, anywhere from 0 up to the exponent in n. For 360 you choose the power of 2 from {0,1,2,3}, the power of 3 from {0,1,2}, and the power of 5 from {0,1}. That is 4 × 3 × 2 = 24 combinations, and each one gives a different divisor because factorisations are unique. Hence
d(n) = (e₁ + 1)(e₂ + 1)⋯
The divisor sum comes from the same construction. Multiply out the product
(1 + 2 + 4 + 8)(1 + 3 + 9)(1 + 5)
and every term of the expansion is exactly one divisor of 360, each appearing once. So the product of those sums is σ(360) = 15 × 13 × 6 = 1,170. Each bracket is a geometric series, which closes to
σ(n) = ∏ (pᵢeᵢ+1 − 1) / (pᵢ − 1)
Both functions are multiplicative: if a and b share no common factor, then d(ab) = d(a)d(b) and σ(ab) = σ(a)σ(b). The coprimality condition is essential. d(4) = 3 and d(6) = 4, but d(24) = 8, not 12, because 4 and 6 share a factor of 2. Getting the prime factorisation right is therefore the whole job; everything else is bookkeeping.
Worked example: every factor of 360
Step 1 — factorise. Divide out the small primes in turn: 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, and 45 is odd. Then 45 ÷ 3 = 15, ÷ 3 = 5, and 5 is prime. So
360 = 2³ × 3² × 5
Step 2 — count. The exponents are 3, 2 and 1, so d(360) = (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24 divisors.
Step 3 — sum. Apply the geometric-series form to each prime:
- For 2³: (2⁴ − 1) ÷ (2 − 1) = 15 ÷ 1 = 15. Check by addition: 1 + 2 + 4 + 8 = 15. ✓
- For 3²: (3³ − 1) ÷ (3 − 1) = 26 ÷ 2 = 13. Check: 1 + 3 + 9 = 13. ✓
- For 5¹: (5² − 1) ÷ (5 − 1) = 24 ÷ 4 = 6. Check: 1 + 5 = 6. ✓
So σ(360) = 15 × 13 × 6 = 1,170.
Step 4 — classify. The proper divisor sum is 1,170 − 360 = 810, which is more than 360, so 360 is abundant — and comfortably so, at 2.25 times its own size.
Step 5 — list them by pairing. Test each candidate up to √360 ≈ 18.97, so up to 18, and read off the partner:
1×360, 2×180, 3×120, 4×90, 5×72, 6×60, 8×45, 9×40, 10×36, 12×30, 15×24, 18×20.
Twelve pairs, twenty-four divisors, matching d(360) exactly — which is the check that no candidate was missed. Note that 7, 11, 13, 14, 16 and 17 are absent because none divides 360, and that 360 is not a perfect square, so no divisor pairs with itself and the count is even.
What the divisor count and divisor sum tell you
A high divisor count means the number is flexible. This is not idle: 60 has twelve divisors while the nearby 59 has two, which is exactly why an hour has 60 minutes and a circle 360 degrees. Both can be divided into halves, thirds, quarters, fifths, sixths and more without fractions. Numbers with more divisors than any smaller number are called highly composite, and 360 is one of them.
The classification compares σ(n) − n against n. Deficient means the proper divisors fall short, perfect means they hit it exactly, abundant means they overshoot. Every prime is maximally deficient, with a proper divisor sum of 1. Every multiple of a perfect number other than the number itself is abundant, and every multiple of an abundant number is abundant, which is why abundance spreads: the smallest abundant number is 12, and abundant numbers make up roughly a quarter of all integers.
Perfect numbers are rare and structured. Euclid proved that if 2p − 1 is prime then 2p−1(2p − 1) is perfect, which generates 6, 28, 496, 8128 and onward; Euler proved every even perfect number has that form. Whether any odd perfect number exists is still open after more than two thousand years, and it is one of the oldest unsolved problems in mathematics.
Do not read the divisor sum as a measure of size. σ(n) grows irregularly, jumping high at highly composite numbers and sitting at n + 1 for every prime. A number with a large σ is not a large number; it is a number with a rich factorisation.
Divisor count, divisor sum and classification for representative numbers
| n | Prime factorisation | d(n) | σ(n) | σ(n) − n | Class |
|---|---|---|---|---|---|
| 6 | 2 × 3 | 4 | 12 | 6 | Perfect |
| 12 | 2² × 3 | 6 | 28 | 16 | Abundant |
| 16 | 2⁴ | 5 | 31 | 15 | Deficient |
| 28 | 2² × 7 | 6 | 56 | 28 | Perfect |
| 36 | 2² × 3² | 9 | 91 | 55 | Abundant |
| 60 | 2² × 3 × 5 | 12 | 168 | 108 | Abundant |
| 97 | 97 | 2 | 98 | 1 | Deficient |
| 100 | 2² × 5² | 9 | 217 | 117 | Abundant |
| 360 | 2³ × 3² × 5 | 24 | 1170 | 810 | Abundant |
| 496 | 2⁴ × 31 | 10 | 992 | 496 | Perfect |
16 and 36 both have an odd divisor count because they are perfect squares, and their middle divisor pairs with itself. 6, 28 and 496 are the first three perfect numbers, each of the form 2^(p−1)(2^p − 1) with the second factor prime.
Mistakes and misunderstandings about factors
- Confusing factors with prime factors. 360 has 24 divisors but only three distinct prime factors. The prime factorisation is the recipe; the divisor list is everything you can build from it.
- Forgetting 1 and n. Both are divisors. Excluding them gives the proper divisors, and the two conventions differ by 1 and by n, which is exactly the difference between the divisor sum and the classification test.
- Applying multiplicativity to numbers that share a factor. d(ab) = d(a)d(b) holds only when a and b are coprime. d(4)d(6) = 12, but d(24) = 8.
- Searching past the square root. Every divisor above √n already appeared as the partner of one below it. Testing beyond the square root doubles the work and finds nothing new.
- Assuming an even divisor count. Perfect squares have an odd one, because their square root pairs with itself.
- Treating 1 as prime. It has one divisor, not two, so it is neither prime nor composite. Making it prime would break the uniqueness of factorisation, since 12 could then be written 2²×3, 1×2²×3, 1²×2²×3 and so on.
Where divisor lists get used
Simplifying fractions needs the largest divisor two numbers share. Rather than listing all factors of both and intersecting, use Euclid's algorithm — the greatest common factor calculator does this in a handful of steps regardless of how large the numbers are, which is why it beats factorisation for that job.
Finding a common denominator needs the least common multiple, which takes the highest power of each prime rather than the lowest. The identity gcd(a,b) × lcm(a,b) = ab links the two, so either one gives the other by a single division.
Arranging things in rectangles is a factor-pair problem in disguise. The number of distinct rectangular arrangements of n objects is the number of factor pairs, which is d(n)/2 rounded up. Thirty-six chairs can be set out in five ways (1×36, 2×18, 3×12, 4×9, 6×6) because d(36) = 9.
Cryptography depends on factoring being hard. Every method here works by finding small factors, and that is exactly why RSA keys are built from two large primes: a number with no small factors defeats trial division, and no fast general method is known. The divisor count of an RSA modulus is 4, which is the whole point — the difficulty is not in counting the divisors but in finding them.
Finally, if what you actually want is the remainder rather than the divisors, the long division calculator shows the working, and the modulo calculator reduces it to the residue that modular arithmetic uses.
