Divisors of a Number
The calculator finds all divisors of a number, how many there are and their sum, and checks whether the number is prime or composite.
The divisors calculator checks whether a number is prime or composite and finds all its divisors, how many there are and their sum. It works with natural numbers up to 1,000,000,000,000.
What is a divisor
A divisor of a natural number n is a natural number that divides n without a remainder. For example, the divisors of 12 are 1, 2, 3, 4, 6, 12.
Prime and composite numbers
- A prime number has exactly two divisors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13, 97.
- A composite number has more than two divisors. Examples: 4, 6, 12, 100.
- The number 1 has one divisor and is neither prime nor composite.
Primes up to 50: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47
How to check whether a number is prime
It is enough to test divisibility by the numbers from 2 to √n. If a number has a divisor greater than √n, it must also have a paired divisor smaller than √n.
Example. Is 97 prime?
√97 ≈ 9.85. Test 2, 3, 5, 7 — 97 is not divisible by any of them.
Answer: 97 is a prime number
How to find all divisors
Look for divisors in pairs: if d is a divisor of n, then n ÷ d is a divisor too. Try every d from 1 to √n.
Example. Divisors of 36:
1 · 36, 2 · 18, 3 · 12, 4 · 9, 6 · 6
Answer: 1, 2, 3, 4, 6, 9, 12, 18, 36 — 9 divisors in total.
Number of divisors from the prime factorization
If a number is factored into primes as n = p1a · p2b · …, the number of its divisors is (a + 1) · (b + 1) · …
Example. 360 = 23 · 32 · 5
Number of divisors: (3 + 1) · (2 + 1) · (1 + 1) = 24
If the sum of all divisors of a number other than the number itself equals the number, it is called a perfect number: 6 = 1 + 2 + 3, 28 = 1 + 2 + 4 + 7 + 14.