What are the divisors of 5176?
1, 2, 4, 8, 647, 1294, 2588, 5176
- There is a total of 8 positive divisors.
- The sum of these divisors is 9720.
- The arithmetic mean is 1215.
6 even divisors
2, 4, 8, 1294, 2588, 5176
2 odd divisors
1, 647
How to compute the divisors of 5176?
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 5176 by each of the numbers from 1 to 5176 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5176 / 1 = 5176 (the remainder is 0, so 1 is a divisor of 5176)
- 5176 / 2 = 2588 (the remainder is 0, so 2 is a divisor of 5176)
- 5176 / 3 = 1725.3333333333 (the remainder is 1, so 3 is not a divisor of 5176)
- ...
- 5176 / 5175 = 1.000193236715 (the remainder is 1, so 5175 is not a divisor of 5176)
- 5176 / 5176 = 1 (the remainder is 0, so 5176 is a divisor of 5176)
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 5176 (i.e. 71.94442299442). 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 )
- 5176 / 1 = 5176 (the remainder is 0, so 1 and 5176 are divisors of 5176)
- 5176 / 2 = 2588 (the remainder is 0, so 2 and 2588 are divisors of 5176)
- 5176 / 3 = 1725.3333333333 (the remainder is 1, so 3 is not a divisor of 5176)
- ...
- 5176 / 70 = 73.942857142857 (the remainder is 66, so 70 is not a divisor of 5176)
- 5176 / 71 = 72.901408450704 (the remainder is 64, so 71 is not a divisor of 5176)