What are the divisors of 498?
1, 2, 3, 6, 83, 166, 249, 498
- There is a total of 8 positive divisors.
- The sum of these divisors is 1008.
- The arithmetic mean is 126.
4 even divisors
2, 6, 166, 498
4 odd divisors
1, 3, 83, 249
How to compute the divisors of 498?
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 498 by each of the numbers from 1 to 498 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 498 / 1 = 498 (the remainder is 0, so 1 is a divisor of 498)
- 498 / 2 = 249 (the remainder is 0, so 2 is a divisor of 498)
- 498 / 3 = 166 (the remainder is 0, so 3 is a divisor of 498)
- ...
- 498 / 497 = 1.0020120724346 (the remainder is 1, so 497 is not a divisor of 498)
- 498 / 498 = 1 (the remainder is 0, so 498 is a divisor of 498)
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 498 (i.e. 22.315913604421). 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 )
- 498 / 1 = 498 (the remainder is 0, so 1 and 498 are divisors of 498)
- 498 / 2 = 249 (the remainder is 0, so 2 and 249 are divisors of 498)
- 498 / 3 = 166 (the remainder is 0, so 3 and 166 are divisors of 498)
- ...
- 498 / 21 = 23.714285714286 (the remainder is 15, so 21 is not a divisor of 498)
- 498 / 22 = 22.636363636364 (the remainder is 14, so 22 is not a divisor of 498)