What are the divisors of 164?
1, 2, 4, 41, 82, 164
- There is a total of 6 positive divisors.
- The sum of these divisors is 294.
- The arithmetic mean is 49.
4 even divisors
2, 4, 82, 164
2 odd divisors
1, 41
How to compute the divisors of 164?
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 164 by each of the numbers from 1 to 164 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 164 / 1 = 164 (the remainder is 0, so 1 is a divisor of 164)
- 164 / 2 = 82 (the remainder is 0, so 2 is a divisor of 164)
- 164 / 3 = 54.666666666667 (the remainder is 2, so 3 is not a divisor of 164)
- ...
- 164 / 163 = 1.0061349693252 (the remainder is 1, so 163 is not a divisor of 164)
- 164 / 164 = 1 (the remainder is 0, so 164 is a divisor of 164)
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 164 (i.e. 12.806248474866). 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 )
- 164 / 1 = 164 (the remainder is 0, so 1 and 164 are divisors of 164)
- 164 / 2 = 82 (the remainder is 0, so 2 and 82 are divisors of 164)
- 164 / 3 = 54.666666666667 (the remainder is 2, so 3 is not a divisor of 164)
- ...
- 164 / 11 = 14.909090909091 (the remainder is 10, so 11 is not a divisor of 164)
- 164 / 12 = 13.666666666667 (the remainder is 8, so 12 is not a divisor of 164)