What are the divisors of 9138?
1, 2, 3, 6, 1523, 3046, 4569, 9138
- There is a total of 8 positive divisors.
- The sum of these divisors is 18288.
- The arithmetic mean is 2286.
4 even divisors
2, 6, 3046, 9138
4 odd divisors
1, 3, 1523, 4569
How to compute the divisors of 9138?
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 9138 by each of the numbers from 1 to 9138 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 9138 / 1 = 9138 (the remainder is 0, so 1 is a divisor of 9138)
- 9138 / 2 = 4569 (the remainder is 0, so 2 is a divisor of 9138)
- 9138 / 3 = 3046 (the remainder is 0, so 3 is a divisor of 9138)
- ...
- 9138 / 9137 = 1.0001094451133 (the remainder is 1, so 9137 is not a divisor of 9138)
- 9138 / 9138 = 1 (the remainder is 0, so 9138 is a divisor of 9138)
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 9138 (i.e. 95.592886764654). 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 )
- 9138 / 1 = 9138 (the remainder is 0, so 1 and 9138 are divisors of 9138)
- 9138 / 2 = 4569 (the remainder is 0, so 2 and 4569 are divisors of 9138)
- 9138 / 3 = 3046 (the remainder is 0, so 3 and 3046 are divisors of 9138)
- ...
- 9138 / 94 = 97.212765957447 (the remainder is 20, so 94 is not a divisor of 9138)
- 9138 / 95 = 96.189473684211 (the remainder is 18, so 95 is not a divisor of 9138)