How it works
Every whole number above 1 can be written as a product of primes in exactly one way (the fundamental theorem of arithmetic). The calculator first finds that prime factorization, then builds everything else from it.
number of factors = (a + 1)(b + 1)…
sum of factors = (p1a+1 − 1)/(p1 − 1) × (p2b+1 − 1)/(p2 − 1) × …
To find the primes, it divides by every small prime up to 1,009. Whatever is left is tested with the Miller–Rabin test and, if it isn't prime, split with Pollard's rho method, which finds the large factors of a 19-digit number in a fraction of a second.
Worked example: 360
- Prime factorization: 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.
- Number of factors: (3 + 1)(2 + 1)(1 + 1) = 4 × 3 × 2 = 24.
- Sum of factors: (2⁴ − 1)/1 × (3³ − 1)/2 × (5² − 1)/4 = 15 × 13 × 6 = 1,170.
- Factor pairs: 1 × 360, 2 × 180, 3 × 120, 4 × 90, 5 × 72, 6 × 60, 8 × 45, 9 × 40, 10 × 36, 12 × 30, 15 × 24, 18 × 20.
Prime, composite, perfect
- A prime has exactly two factors, 1 and itself. A composite number has more. 1 is neither.
- A perfect number equals the sum of its other factors: 28 = 1 + 2 + 4 + 7 + 14. If the sum is bigger, the number is abundant; if smaller, deficient.
- A number is a perfect square when every exponent in its prime factorization is even: 144 = 2⁴ × 3².
Limits
- Numbers up to 19 digits are factored completely. For a bigger number, the prime number checker can still tell you if it's prime.
- When a number has more than 5,000 factors, the count and sum are still exact, but the list isn't shown.
- Factors here are positive. For a negative number, each factor also has a negative partner.