What are the divisors of 5026?
1, 2, 7, 14, 359, 718, 2513, 5026
- There is a total of 8 positive divisors.
- The sum of these divisors is 8640.
- The arithmetic mean is 1080.
4 even divisors
2, 14, 718, 5026
4 odd divisors
1, 7, 359, 2513
How to compute the divisors of 5026?
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 5026 by each of the numbers from 1 to 5026 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5026 / 1 = 5026 (the remainder is 0, so 1 is a divisor of 5026)
- 5026 / 2 = 2513 (the remainder is 0, so 2 is a divisor of 5026)
- 5026 / 3 = 1675.3333333333 (the remainder is 1, so 3 is not a divisor of 5026)
- ...
- 5026 / 5025 = 1.0001990049751 (the remainder is 1, so 5025 is not a divisor of 5026)
- 5026 / 5026 = 1 (the remainder is 0, so 5026 is a divisor of 5026)
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 5026 (i.e. 70.894287499064). 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 )
- 5026 / 1 = 5026 (the remainder is 0, so 1 and 5026 are divisors of 5026)
- 5026 / 2 = 2513 (the remainder is 0, so 2 and 2513 are divisors of 5026)
- 5026 / 3 = 1675.3333333333 (the remainder is 1, so 3 is not a divisor of 5026)
- ...
- 5026 / 69 = 72.840579710145 (the remainder is 58, so 69 is not a divisor of 5026)
- 5026 / 70 = 71.8 (the remainder is 56, so 70 is not a divisor of 5026)