What are the divisors of 5058?
1, 2, 3, 6, 9, 18, 281, 562, 843, 1686, 2529, 5058
- There is a total of 12 positive divisors.
- The sum of these divisors is 10998.
- The arithmetic mean is 916.5.
6 even divisors
2, 6, 18, 562, 1686, 5058
6 odd divisors
1, 3, 9, 281, 843, 2529
How to compute the divisors of 5058?
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 5058 by each of the numbers from 1 to 5058 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5058 / 1 = 5058 (the remainder is 0, so 1 is a divisor of 5058)
- 5058 / 2 = 2529 (the remainder is 0, so 2 is a divisor of 5058)
- 5058 / 3 = 1686 (the remainder is 0, so 3 is a divisor of 5058)
- ...
- 5058 / 5057 = 1.000197745699 (the remainder is 1, so 5057 is not a divisor of 5058)
- 5058 / 5058 = 1 (the remainder is 0, so 5058 is a divisor of 5058)
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 5058 (i.e. 71.119617546778). 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 )
- 5058 / 1 = 5058 (the remainder is 0, so 1 and 5058 are divisors of 5058)
- 5058 / 2 = 2529 (the remainder is 0, so 2 and 2529 are divisors of 5058)
- 5058 / 3 = 1686 (the remainder is 0, so 3 and 1686 are divisors of 5058)
- ...
- 5058 / 70 = 72.257142857143 (the remainder is 18, so 70 is not a divisor of 5058)
- 5058 / 71 = 71.239436619718 (the remainder is 17, so 71 is not a divisor of 5058)