What are the divisors of 2502?
1, 2, 3, 6, 9, 18, 139, 278, 417, 834, 1251, 2502
- There is a total of 12 positive divisors.
- The sum of these divisors is 5460.
- The arithmetic mean is 455.
6 even divisors
2, 6, 18, 278, 834, 2502
6 odd divisors
1, 3, 9, 139, 417, 1251
How to compute the divisors of 2502?
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 2502 by each of the numbers from 1 to 2502 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 2502 / 1 = 2502 (the remainder is 0, so 1 is a divisor of 2502)
- 2502 / 2 = 1251 (the remainder is 0, so 2 is a divisor of 2502)
- 2502 / 3 = 834 (the remainder is 0, so 3 is a divisor of 2502)
- ...
- 2502 / 2501 = 1.000399840064 (the remainder is 1, so 2501 is not a divisor of 2502)
- 2502 / 2502 = 1 (the remainder is 0, so 2502 is a divisor of 2502)
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 2502 (i.e. 50.019996001599). 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 )
- 2502 / 1 = 2502 (the remainder is 0, so 1 and 2502 are divisors of 2502)
- 2502 / 2 = 1251 (the remainder is 0, so 2 and 1251 are divisors of 2502)
- 2502 / 3 = 834 (the remainder is 0, so 3 and 834 are divisors of 2502)
- ...
- 2502 / 49 = 51.061224489796 (the remainder is 3, so 49 is not a divisor of 2502)
- 2502 / 50 = 50.04 (the remainder is 2, so 50 is not a divisor of 2502)