What are the divisors of 6172?
1, 2, 4, 1543, 3086, 6172
- There is a total of 6 positive divisors.
- The sum of these divisors is 10808.
- The arithmetic mean is 1801.3333333333.
4 even divisors
2, 4, 3086, 6172
2 odd divisors
1, 1543
How to compute the divisors of 6172?
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 6172 by each of the numbers from 1 to 6172 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 6172 / 1 = 6172 (the remainder is 0, so 1 is a divisor of 6172)
- 6172 / 2 = 3086 (the remainder is 0, so 2 is a divisor of 6172)
- 6172 / 3 = 2057.3333333333 (the remainder is 1, so 3 is not a divisor of 6172)
- ...
- 6172 / 6171 = 1.0001620482904 (the remainder is 1, so 6171 is not a divisor of 6172)
- 6172 / 6172 = 1 (the remainder is 0, so 6172 is a divisor of 6172)
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 6172 (i.e. 78.562077365609). 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 )
- 6172 / 1 = 6172 (the remainder is 0, so 1 and 6172 are divisors of 6172)
- 6172 / 2 = 3086 (the remainder is 0, so 2 and 3086 are divisors of 6172)
- 6172 / 3 = 2057.3333333333 (the remainder is 1, so 3 is not a divisor of 6172)
- ...
- 6172 / 77 = 80.155844155844 (the remainder is 12, so 77 is not a divisor of 6172)
- 6172 / 78 = 79.128205128205 (the remainder is 10, so 78 is not a divisor of 6172)