What are the divisors of 2582?
1, 2, 1291, 2582
- There is a total of 4 positive divisors.
- The sum of these divisors is 3876.
- The arithmetic mean is 969.
2 even divisors
2, 2582
2 odd divisors
1, 1291
How to compute the divisors of 2582?
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 2582 by each of the numbers from 1 to 2582 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 2582 / 1 = 2582 (the remainder is 0, so 1 is a divisor of 2582)
- 2582 / 2 = 1291 (the remainder is 0, so 2 is a divisor of 2582)
- 2582 / 3 = 860.66666666667 (the remainder is 2, so 3 is not a divisor of 2582)
- ...
- 2582 / 2581 = 1.0003874467261 (the remainder is 1, so 2581 is not a divisor of 2582)
- 2582 / 2582 = 1 (the remainder is 0, so 2582 is a divisor of 2582)
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 2582 (i.e. 50.81338406365). 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 )
- 2582 / 1 = 2582 (the remainder is 0, so 1 and 2582 are divisors of 2582)
- 2582 / 2 = 1291 (the remainder is 0, so 2 and 1291 are divisors of 2582)
- 2582 / 3 = 860.66666666667 (the remainder is 2, so 3 is not a divisor of 2582)
- ...
- 2582 / 49 = 52.69387755102 (the remainder is 34, so 49 is not a divisor of 2582)
- 2582 / 50 = 51.64 (the remainder is 32, so 50 is not a divisor of 2582)