What are the divisors of 8172?
1, 2, 3, 4, 6, 9, 12, 18, 36, 227, 454, 681, 908, 1362, 2043, 2724, 4086, 8172
- There is a total of 18 positive divisors.
- The sum of these divisors is 20748.
- The arithmetic mean is 1152.6666666667.
12 even divisors
2, 4, 6, 12, 18, 36, 454, 908, 1362, 2724, 4086, 8172
6 odd divisors
1, 3, 9, 227, 681, 2043
How to compute the divisors of 8172?
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 8172 by each of the numbers from 1 to 8172 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 8172 / 1 = 8172 (the remainder is 0, so 1 is a divisor of 8172)
- 8172 / 2 = 4086 (the remainder is 0, so 2 is a divisor of 8172)
- 8172 / 3 = 2724 (the remainder is 0, so 3 is a divisor of 8172)
- ...
- 8172 / 8171 = 1.0001223840411 (the remainder is 1, so 8171 is not a divisor of 8172)
- 8172 / 8172 = 1 (the remainder is 0, so 8172 is a divisor of 8172)
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 8172 (i.e. 90.399115039916). 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 )
- 8172 / 1 = 8172 (the remainder is 0, so 1 and 8172 are divisors of 8172)
- 8172 / 2 = 4086 (the remainder is 0, so 2 and 4086 are divisors of 8172)
- 8172 / 3 = 2724 (the remainder is 0, so 3 and 2724 are divisors of 8172)
- ...
- 8172 / 89 = 91.820224719101 (the remainder is 73, so 89 is not a divisor of 8172)
- 8172 / 90 = 90.8 (the remainder is 72, so 90 is not a divisor of 8172)