What are the divisors of 52?
1, 2, 4, 13, 26, 52
- There is a total of 6 positive divisors.
- The sum of these divisors is 98.
- The arithmetic mean is 16.333333333333.
4 even divisors
2, 4, 26, 52
2 odd divisors
1, 13
How to compute the divisors of 52?
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 52 by each of the numbers from 1 to 52 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 52 / 1 = 52 (the remainder is 0, so 1 is a divisor of 52)
- 52 / 2 = 26 (the remainder is 0, so 2 is a divisor of 52)
- 52 / 3 = 17.333333333333 (the remainder is 1, so 3 is not a divisor of 52)
- ...
- 52 / 51 = 1.0196078431373 (the remainder is 1, so 51 is not a divisor of 52)
- 52 / 52 = 1 (the remainder is 0, so 52 is a divisor of 52)
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 52 (i.e. 7.211102550928). 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 )
- 52 / 1 = 52 (the remainder is 0, so 1 and 52 are divisors of 52)
- 52 / 2 = 26 (the remainder is 0, so 2 and 26 are divisors of 52)
- 52 / 3 = 17.333333333333 (the remainder is 1, so 3 is not a divisor of 52)
- ...
- 52 / 6 = 8.6666666666667 (the remainder is 4, so 6 is not a divisor of 52)
- 52 / 7 = 7.4285714285714 (the remainder is 3, so 7 is not a divisor of 52)