What are the divisors of 218?
1, 2, 109, 218
- There is a total of 4 positive divisors.
- The sum of these divisors is 330.
- The arithmetic mean is 82.5.
2 even divisors
2, 218
2 odd divisors
1, 109
How to compute the divisors of 218?
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 218 by each of the numbers from 1 to 218 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 218 / 1 = 218 (the remainder is 0, so 1 is a divisor of 218)
- 218 / 2 = 109 (the remainder is 0, so 2 is a divisor of 218)
- 218 / 3 = 72.666666666667 (the remainder is 2, so 3 is not a divisor of 218)
- ...
- 218 / 217 = 1.0046082949309 (the remainder is 1, so 217 is not a divisor of 218)
- 218 / 218 = 1 (the remainder is 0, so 218 is a divisor of 218)
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 218 (i.e. 14.764823060233). 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 )
- 218 / 1 = 218 (the remainder is 0, so 1 and 218 are divisors of 218)
- 218 / 2 = 109 (the remainder is 0, so 2 and 109 are divisors of 218)
- 218 / 3 = 72.666666666667 (the remainder is 2, so 3 is not a divisor of 218)
- ...
- 218 / 13 = 16.769230769231 (the remainder is 10, so 13 is not a divisor of 218)
- 218 / 14 = 15.571428571429 (the remainder is 8, so 14 is not a divisor of 218)