What are the divisors of 5212?
1, 2, 4, 1303, 2606, 5212
- There is a total of 6 positive divisors.
- The sum of these divisors is 9128.
- The arithmetic mean is 1521.3333333333.
4 even divisors
2, 4, 2606, 5212
2 odd divisors
1, 1303
How to compute the divisors of 5212?
A number N is said to be divisible by a number M (with M non-zero) if, when we divide N by M, the remainder of the division is zero.
Brute force algorithm
We could start by using a brute-force method which would involve dividing 5212 by each of the numbers from 1 to 5212 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5212 / 1 = 5212 (the remainder is 0, so 1 is a divisor of 5212)
- 5212 / 2 = 2606 (the remainder is 0, so 2 is a divisor of 5212)
- 5212 / 3 = 1737.3333333333 (the remainder is 1, so 3 is not a divisor of 5212)
- ...
- 5212 / 5211 = 1.0001919017463 (the remainder is 1, so 5211 is not a divisor of 5212)
- 5212 / 5212 = 1 (the remainder is 0, so 5212 is a divisor of 5212)
Improved algorithm using square-root
However, there is another slightly better approach that reduces the number of iterations by testing only integers less than or equal to the square root of 5212 (i.e. 72.19418259112). Indeed, if a number N has a divisor D greater than its square root, then there is necessarily a smaller divisor d such that:
(thus, if , then )
- 5212 / 1 = 5212 (the remainder is 0, so 1 and 5212 are divisors of 5212)
- 5212 / 2 = 2606 (the remainder is 0, so 2 and 2606 are divisors of 5212)
- 5212 / 3 = 1737.3333333333 (the remainder is 1, so 3 is not a divisor of 5212)
- ...
- 5212 / 71 = 73.408450704225 (the remainder is 29, so 71 is not a divisor of 5212)
- 5212 / 72 = 72.388888888889 (the remainder is 28, so 72 is not a divisor of 5212)