Factor Calculator
List every divisor of a positive integer, all factor pairs, the count and sum of divisors (sigma), and flag the number as prime, composite, perfect square, perfect, abundant, or deficient.
Frequently Asked Questions about the Factor Calculator
What is the difference between factors, prime factors, and a factorial?
Factors of n are every positive integer that divides n with no remainder, including 1 and n itself. So the factors of 12 are 1, 2, 3, 4, 6, 12. Prime factors are the subset of those divisors that are prime; for 12 they are just 2 and 3, written with multiplicity as 12 = 2^2 x 3. A factorial, written n!, is a completely different operation: it is the product of every integer from 1 up to n, so 5! = 1 x 2 x 3 x 4 x 5 = 120. This page lists every divisor (use /prime-factorization-calculator/ for the prime breakdown and /factorial-calculator/ for n!).
What is a perfect number, and how many do we know?
A perfect number equals the sum of its proper divisors. The smallest are 6, 28, 496, and 8,128. Each known Mersenne prime generates an even perfect number through the Euclid-Euler formula. With 52 known Mersenne primes, 52 even perfect numbers are known. No odd perfect number has been found or proved impossible.
What are abundant and deficient numbers?
Take the proper divisors of n (every divisor below n itself) and add them up. If the sum is larger than n the number is abundant, if smaller it is deficient, if equal it is perfect. Examples: 12 has proper divisors 1, 2, 3, 4, 6 summing to 16, so 12 is abundant. 8 has proper divisors 1, 2, 4 summing to 7, so 8 is deficient. Every prime p is deficient because its only proper divisor is 1. Most small numbers are deficient. The smallest odd abundant number is 945, which is why people often (incorrectly) assume abundant numbers must be even.
Why does this calculator only loop up to the square root of n?
Every divisor pairs up. If d divides n then n/d also divides n, and one member of the pair is always at or below sqrt(n) while the other is at or above it. So a loop from 1 to floor(sqrt(n)) sees every divisor exactly once via its smaller partner; the algorithm just records both i and n/i whenever i divides n. That cuts the work from O(n) to O(sqrt(n)): for the maximum input of 10^9, sqrt is about 31,623 iterations, which finishes in milliseconds. A naive O(n) loop would do a billion iterations and freeze your browser.
Why does 1 have only one factor (itself)?
By definition, a factor of n is a positive integer that divides n with no remainder. The only positive integer that divides 1 is 1, so the list is just {1}. This also explains why 1 is neither prime nor composite: a prime has exactly two distinct factors (1 and itself), and 1 only has one factor, so it cannot be prime. Treating 1 as not prime keeps the Fundamental Theorem of Arithmetic clean: every integer above 1 has a unique prime factorization, which would fail if 1 were prime (because you could pad any factorization with extra 1s). The calculator returns 1 as a deficient number with sigma(1) = 1 and sum of proper divisors = 0.
Related Calculators
More calculators in "Math"
Surface Area CalculatorInches to Fraction Calculator45-45-90 Triangle Calculator30-60-90 Triangle CalculatorVertex Form CalculatorQuadratic Equation Calculator
See all 202 calculators in "Math"