What are the divisors of 5006?
1, 2, 2503, 5006
- There is a total of 4 positive divisors.
- The sum of these divisors is 7512.
- The arithmetic mean is 1878.
2 even divisors
2, 5006
2 odd divisors
1, 2503
How to compute the divisors of 5006?
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 5006 by each of the numbers from 1 to 5006 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5006 / 1 = 5006 (the remainder is 0, so 1 is a divisor of 5006)
- 5006 / 2 = 2503 (the remainder is 0, so 2 is a divisor of 5006)
- 5006 / 3 = 1668.6666666667 (the remainder is 2, so 3 is not a divisor of 5006)
- ...
- 5006 / 5005 = 1.0001998001998 (the remainder is 1, so 5005 is not a divisor of 5006)
- 5006 / 5006 = 1 (the remainder is 0, so 5006 is a divisor of 5006)
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 5006 (i.e. 70.753091805235). 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 )
- 5006 / 1 = 5006 (the remainder is 0, so 1 and 5006 are divisors of 5006)
- 5006 / 2 = 2503 (the remainder is 0, so 2 and 2503 are divisors of 5006)
- 5006 / 3 = 1668.6666666667 (the remainder is 2, so 3 is not a divisor of 5006)
- ...
- 5006 / 69 = 72.550724637681 (the remainder is 38, so 69 is not a divisor of 5006)
- 5006 / 70 = 71.514285714286 (the remainder is 36, so 70 is not a divisor of 5006)