What are the divisors of 5020?
1, 2, 4, 5, 10, 20, 251, 502, 1004, 1255, 2510, 5020
- There is a total of 12 positive divisors.
- The sum of these divisors is 10584.
- The arithmetic mean is 882.
8 even divisors
2, 4, 10, 20, 502, 1004, 2510, 5020
4 odd divisors
1, 5, 251, 1255
How to compute the divisors of 5020?
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 5020 by each of the numbers from 1 to 5020 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5020 / 1 = 5020 (the remainder is 0, so 1 is a divisor of 5020)
- 5020 / 2 = 2510 (the remainder is 0, so 2 is a divisor of 5020)
- 5020 / 3 = 1673.3333333333 (the remainder is 1, so 3 is not a divisor of 5020)
- ...
- 5020 / 5019 = 1.0001992428771 (the remainder is 1, so 5019 is not a divisor of 5020)
- 5020 / 5020 = 1 (the remainder is 0, so 5020 is a divisor of 5020)
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 5020 (i.e. 70.851958335673). 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 )
- 5020 / 1 = 5020 (the remainder is 0, so 1 and 5020 are divisors of 5020)
- 5020 / 2 = 2510 (the remainder is 0, so 2 and 2510 are divisors of 5020)
- 5020 / 3 = 1673.3333333333 (the remainder is 1, so 3 is not a divisor of 5020)
- ...
- 5020 / 69 = 72.753623188406 (the remainder is 52, so 69 is not a divisor of 5020)
- 5020 / 70 = 71.714285714286 (the remainder is 50, so 70 is not a divisor of 5020)