What are the divisors of 2538?
1, 2, 3, 6, 9, 18, 27, 47, 54, 94, 141, 282, 423, 846, 1269, 2538
- There is a total of 16 positive divisors.
- The sum of these divisors is 5760.
- The arithmetic mean is 360.
8 even divisors
2, 6, 18, 54, 94, 282, 846, 2538
8 odd divisors
1, 3, 9, 27, 47, 141, 423, 1269
How to compute the divisors of 2538?
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 2538 by each of the numbers from 1 to 2538 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 2538 / 1 = 2538 (the remainder is 0, so 1 is a divisor of 2538)
- 2538 / 2 = 1269 (the remainder is 0, so 2 is a divisor of 2538)
- 2538 / 3 = 846 (the remainder is 0, so 3 is a divisor of 2538)
- ...
- 2538 / 2537 = 1.0003941663382 (the remainder is 1, so 2537 is not a divisor of 2538)
- 2538 / 2538 = 1 (the remainder is 0, so 2538 is a divisor of 2538)
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 2538 (i.e. 50.37856687124). 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 )
- 2538 / 1 = 2538 (the remainder is 0, so 1 and 2538 are divisors of 2538)
- 2538 / 2 = 1269 (the remainder is 0, so 2 and 1269 are divisors of 2538)
- 2538 / 3 = 846 (the remainder is 0, so 3 and 846 are divisors of 2538)
- ...
- 2538 / 49 = 51.795918367347 (the remainder is 39, so 49 is not a divisor of 2538)
- 2538 / 50 = 50.76 (the remainder is 38, so 50 is not a divisor of 2538)