What are the divisors of 1804?
1, 2, 4, 11, 22, 41, 44, 82, 164, 451, 902, 1804
- There is a total of 12 positive divisors.
- The sum of these divisors is 3528.
- The arithmetic mean is 294.
8 even divisors
2, 4, 22, 44, 82, 164, 902, 1804
4 odd divisors
1, 11, 41, 451
How to compute the divisors of 1804?
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 1804 by each of the numbers from 1 to 1804 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1804 / 1 = 1804 (the remainder is 0, so 1 is a divisor of 1804)
- 1804 / 2 = 902 (the remainder is 0, so 2 is a divisor of 1804)
- 1804 / 3 = 601.33333333333 (the remainder is 1, so 3 is not a divisor of 1804)
- ...
- 1804 / 1803 = 1.0005546311703 (the remainder is 1, so 1803 is not a divisor of 1804)
- 1804 / 1804 = 1 (the remainder is 0, so 1804 is a divisor of 1804)
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 1804 (i.e. 42.473521163191). 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 )
- 1804 / 1 = 1804 (the remainder is 0, so 1 and 1804 are divisors of 1804)
- 1804 / 2 = 902 (the remainder is 0, so 2 and 902 are divisors of 1804)
- 1804 / 3 = 601.33333333333 (the remainder is 1, so 3 is not a divisor of 1804)
- ...
- 1804 / 41 = 44 (the remainder is 0, so 41 and 44 are divisors of 1804)
- 1804 / 42 = 42.952380952381 (the remainder is 40, so 42 is not a divisor of 1804)