What are the divisors of 2178?
1, 2, 3, 6, 9, 11, 18, 22, 33, 66, 99, 121, 198, 242, 363, 726, 1089, 2178
- There is a total of 18 positive divisors.
- The sum of these divisors is 5187.
- The arithmetic mean is 288.16666666667.
9 even divisors
2, 6, 18, 22, 66, 198, 242, 726, 2178
9 odd divisors
1, 3, 9, 11, 33, 99, 121, 363, 1089
How to compute the divisors of 2178?
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 2178 by each of the numbers from 1 to 2178 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 2178 / 1 = 2178 (the remainder is 0, so 1 is a divisor of 2178)
- 2178 / 2 = 1089 (the remainder is 0, so 2 is a divisor of 2178)
- 2178 / 3 = 726 (the remainder is 0, so 3 is a divisor of 2178)
- ...
- 2178 / 2177 = 1.0004593477262 (the remainder is 1, so 2177 is not a divisor of 2178)
- 2178 / 2178 = 1 (the remainder is 0, so 2178 is a divisor of 2178)
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 2178 (i.e. 46.669047558312). 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 )
- 2178 / 1 = 2178 (the remainder is 0, so 1 and 2178 are divisors of 2178)
- 2178 / 2 = 1089 (the remainder is 0, so 2 and 1089 are divisors of 2178)
- 2178 / 3 = 726 (the remainder is 0, so 3 and 726 are divisors of 2178)
- ...
- 2178 / 45 = 48.4 (the remainder is 18, so 45 is not a divisor of 2178)
- 2178 / 46 = 47.347826086957 (the remainder is 16, so 46 is not a divisor of 2178)