What are the divisors of 5074?
1, 2, 43, 59, 86, 118, 2537, 5074
- There is a total of 8 positive divisors.
- The sum of these divisors is 7920.
- The arithmetic mean is 990.
4 even divisors
2, 86, 118, 5074
4 odd divisors
1, 43, 59, 2537
How to compute the divisors of 5074?
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 5074 by each of the numbers from 1 to 5074 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5074 / 1 = 5074 (the remainder is 0, so 1 is a divisor of 5074)
- 5074 / 2 = 2537 (the remainder is 0, so 2 is a divisor of 5074)
- 5074 / 3 = 1691.3333333333 (the remainder is 1, so 3 is not a divisor of 5074)
- ...
- 5074 / 5073 = 1.0001971220185 (the remainder is 1, so 5073 is not a divisor of 5074)
- 5074 / 5074 = 1 (the remainder is 0, so 5074 is a divisor of 5074)
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 5074 (i.e. 71.232015274033). 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 )
- 5074 / 1 = 5074 (the remainder is 0, so 1 and 5074 are divisors of 5074)
- 5074 / 2 = 2537 (the remainder is 0, so 2 and 2537 are divisors of 5074)
- 5074 / 3 = 1691.3333333333 (the remainder is 1, so 3 is not a divisor of 5074)
- ...
- 5074 / 70 = 72.485714285714 (the remainder is 34, so 70 is not a divisor of 5074)
- 5074 / 71 = 71.464788732394 (the remainder is 33, so 71 is not a divisor of 5074)