What are the divisors of 2506?
1, 2, 7, 14, 179, 358, 1253, 2506
- There is a total of 8 positive divisors.
- The sum of these divisors is 4320.
- The arithmetic mean is 540.
4 even divisors
2, 14, 358, 2506
4 odd divisors
1, 7, 179, 1253
How to compute the divisors of 2506?
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 2506 by each of the numbers from 1 to 2506 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 2506 / 1 = 2506 (the remainder is 0, so 1 is a divisor of 2506)
- 2506 / 2 = 1253 (the remainder is 0, so 2 is a divisor of 2506)
- 2506 / 3 = 835.33333333333 (the remainder is 1, so 3 is not a divisor of 2506)
- ...
- 2506 / 2505 = 1.0003992015968 (the remainder is 1, so 2505 is not a divisor of 2506)
- 2506 / 2506 = 1 (the remainder is 0, so 2506 is a divisor of 2506)
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 2506 (i.e. 50.059964043135). 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 )
- 2506 / 1 = 2506 (the remainder is 0, so 1 and 2506 are divisors of 2506)
- 2506 / 2 = 1253 (the remainder is 0, so 2 and 1253 are divisors of 2506)
- 2506 / 3 = 835.33333333333 (the remainder is 1, so 3 is not a divisor of 2506)
- ...
- 2506 / 49 = 51.142857142857 (the remainder is 7, so 49 is not a divisor of 2506)
- 2506 / 50 = 50.12 (the remainder is 6, so 50 is not a divisor of 2506)