What are the divisors of 108?
1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 54, 108
- There is a total of 12 positive divisors.
- The sum of these divisors is 280.
- The arithmetic mean is 23.333333333333.
8 even divisors
2, 4, 6, 12, 18, 36, 54, 108
4 odd divisors
1, 3, 9, 27
How to compute the divisors of 108?
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 108 by each of the numbers from 1 to 108 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 108 / 1 = 108 (the remainder is 0, so 1 is a divisor of 108)
- 108 / 2 = 54 (the remainder is 0, so 2 is a divisor of 108)
- 108 / 3 = 36 (the remainder is 0, so 3 is a divisor of 108)
- ...
- 108 / 107 = 1.0093457943925 (the remainder is 1, so 107 is not a divisor of 108)
- 108 / 108 = 1 (the remainder is 0, so 108 is a divisor of 108)
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 108 (i.e. 10.392304845413). 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 )
- 108 / 1 = 108 (the remainder is 0, so 1 and 108 are divisors of 108)
- 108 / 2 = 54 (the remainder is 0, so 2 and 54 are divisors of 108)
- 108 / 3 = 36 (the remainder is 0, so 3 and 36 are divisors of 108)
- ...
- 108 / 9 = 12 (the remainder is 0, so 9 and 12 are divisors of 108)
- 108 / 10 = 10.8 (the remainder is 8, so 10 is not a divisor of 108)