How the Divisor Calculator Works
A positive integer d is a divisor (or factor) of a whole number N if N can be divided by d with no remainder — that is, N mod d = 0, or equivalently N = d × k for some whole number k. Every positive integer has at least two divisors, 1 and itself; numbers with exactly those two are the prime numbers. This calculator takes a whole number N, finds every one of its positive divisors, counts them (τ(N)), sums them (σ(N)), and classifies N as prime, perfect, abundant, or deficient based on how that sum compares to N.
Formula and method
Divisors always come in matched pairs: if d divides N, then so does N ÷ d, and d × (N ÷ d) = N. That means you only need to test integers d from 1 up to √N — for every d that divides N evenly, both d and N ÷ d are divisors (they are the same value only when d = √N exactly, so that case is counted once). This trial-division method is what the calculator uses, and it is dramatically faster than checking every integer up to N.
If you know N's prime factorization, N = p1^a1 × p2^a2 × ... × pk^ak, two closed-form results follow directly. The divisor count function is τ(N) = (a1+1)(a2+1)···(ak+1), and the sum-of-divisors function is σ(N) = Π [(pᵢ^(aᵢ+1) − 1) ÷ (pᵢ − 1)]. For example, 60 = 2² × 3¹ × 5¹, so τ(60) = 3 × 2 × 2 = 12 and σ(60) = (2³−1)/(2−1) × (3²−1)/(3−1) × (5²−1)/(5−1) = 7 × 4 × 6 = 168.
Common sources of error
- Forgetting 1 and N: both 1 and N itself always count as divisors of N, even though they are easy to overlook when listing "the factors."
- Divisors vs. prime factors: the divisors of 12 are 1, 2, 3, 4, 6, and 12, but its prime factors are only 2 and 3 — prime factors are the subset of divisors that are themselves prime.
- Perfect squares: when N is a perfect square (like 36), √N divides N and pairs with itself, so it should only be counted once, giving an odd total divisor count.
Checking your result
A few quick sanity checks catch most mistakes: the divisor count τ(N) should be odd only when N is a perfect square, and even otherwise (divisors pair up). The sum σ(N) should always be at least N + 1 for N > 1, since 1 and N are both included. And every value in the divisor list should divide N with zero remainder — spot-check one or two by hand if the list looks off.
Applications
Divisor calculations show up whenever a quantity needs to be split into equal whole groups — scheduling shifts, arranging items into even rows and columns, or simplifying a fraction to lowest terms (which relies on the greatest common divisor of the numerator and denominator). The count of divisors is also a quick way to test primality: exactly two divisors means N is prime. Perfect, abundant, and deficient numbers are a classic topic in number theory, and prime factorization itself underlies cryptographic methods like RSA, which rely on large numbers being hard to factor.