What are the divisors of 186?
1, 2, 3, 6, 31, 62, 93, 186
- There is a total of 8 positive divisors.
- The sum of these divisors is 384.
- The arithmetic mean is 48.
4 even divisors
2, 6, 62, 186
4 odd divisors
1, 3, 31, 93
How to compute the divisors of 186?
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 186 by each of the numbers from 1 to 186 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 186 / 1 = 186 (the remainder is 0, so 1 is a divisor of 186)
- 186 / 2 = 93 (the remainder is 0, so 2 is a divisor of 186)
- 186 / 3 = 62 (the remainder is 0, so 3 is a divisor of 186)
- ...
- 186 / 185 = 1.0054054054054 (the remainder is 1, so 185 is not a divisor of 186)
- 186 / 186 = 1 (the remainder is 0, so 186 is a divisor of 186)
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 186 (i.e. 13.638181696986). 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 )
- 186 / 1 = 186 (the remainder is 0, so 1 and 186 are divisors of 186)
- 186 / 2 = 93 (the remainder is 0, so 2 and 93 are divisors of 186)
- 186 / 3 = 62 (the remainder is 0, so 3 and 62 are divisors of 186)
- ...
- 186 / 12 = 15.5 (the remainder is 6, so 12 is not a divisor of 186)
- 186 / 13 = 14.307692307692 (the remainder is 4, so 13 is not a divisor of 186)