What are the divisors of 5254?
1, 2, 37, 71, 74, 142, 2627, 5254
- There is a total of 8 positive divisors.
- The sum of these divisors is 8208.
- The arithmetic mean is 1026.
4 even divisors
2, 74, 142, 5254
4 odd divisors
1, 37, 71, 2627
How to compute the divisors of 5254?
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 5254 by each of the numbers from 1 to 5254 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5254 / 1 = 5254 (the remainder is 0, so 1 is a divisor of 5254)
- 5254 / 2 = 2627 (the remainder is 0, so 2 is a divisor of 5254)
- 5254 / 3 = 1751.3333333333 (the remainder is 1, so 3 is not a divisor of 5254)
- ...
- 5254 / 5253 = 1.0001903674091 (the remainder is 1, so 5253 is not a divisor of 5254)
- 5254 / 5254 = 1 (the remainder is 0, so 5254 is a divisor of 5254)
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 5254 (i.e. 72.48448109768). 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 )
- 5254 / 1 = 5254 (the remainder is 0, so 1 and 5254 are divisors of 5254)
- 5254 / 2 = 2627 (the remainder is 0, so 2 and 2627 are divisors of 5254)
- 5254 / 3 = 1751.3333333333 (the remainder is 1, so 3 is not a divisor of 5254)
- ...
- 5254 / 71 = 74 (the remainder is 0, so 71 and 74 are divisors of 5254)
- 5254 / 72 = 72.972222222222 (the remainder is 70, so 72 is not a divisor of 5254)