What are the divisors of 604?
1, 2, 4, 151, 302, 604
- There is a total of 6 positive divisors.
- The sum of these divisors is 1064.
- The arithmetic mean is 177.33333333333.
4 even divisors
2, 4, 302, 604
2 odd divisors
1, 151
How to compute the divisors of 604?
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 604 by each of the numbers from 1 to 604 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 604 / 1 = 604 (the remainder is 0, so 1 is a divisor of 604)
- 604 / 2 = 302 (the remainder is 0, so 2 is a divisor of 604)
- 604 / 3 = 201.33333333333 (the remainder is 1, so 3 is not a divisor of 604)
- ...
- 604 / 603 = 1.0016583747927 (the remainder is 1, so 603 is not a divisor of 604)
- 604 / 604 = 1 (the remainder is 0, so 604 is a divisor of 604)
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 604 (i.e. 24.576411454889). 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 )
- 604 / 1 = 604 (the remainder is 0, so 1 and 604 are divisors of 604)
- 604 / 2 = 302 (the remainder is 0, so 2 and 302 are divisors of 604)
- 604 / 3 = 201.33333333333 (the remainder is 1, so 3 is not a divisor of 604)
- ...
- 604 / 23 = 26.260869565217 (the remainder is 6, so 23 is not a divisor of 604)
- 604 / 24 = 25.166666666667 (the remainder is 4, so 24 is not a divisor of 604)