What are the divisors of 1704?
1, 2, 3, 4, 6, 8, 12, 24, 71, 142, 213, 284, 426, 568, 852, 1704
- There is a total of 16 positive divisors.
- The sum of these divisors is 4320.
- The arithmetic mean is 270.
12 even divisors
2, 4, 6, 8, 12, 24, 142, 284, 426, 568, 852, 1704
4 odd divisors
1, 3, 71, 213
How to compute the divisors of 1704?
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 1704 by each of the numbers from 1 to 1704 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1704 / 1 = 1704 (the remainder is 0, so 1 is a divisor of 1704)
- 1704 / 2 = 852 (the remainder is 0, so 2 is a divisor of 1704)
- 1704 / 3 = 568 (the remainder is 0, so 3 is a divisor of 1704)
- ...
- 1704 / 1703 = 1.0005871990605 (the remainder is 1, so 1703 is not a divisor of 1704)
- 1704 / 1704 = 1 (the remainder is 0, so 1704 is a divisor of 1704)
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 1704 (i.e. 41.279534881101). 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 )
- 1704 / 1 = 1704 (the remainder is 0, so 1 and 1704 are divisors of 1704)
- 1704 / 2 = 852 (the remainder is 0, so 2 and 852 are divisors of 1704)
- 1704 / 3 = 568 (the remainder is 0, so 3 and 568 are divisors of 1704)
- ...
- 1704 / 40 = 42.6 (the remainder is 24, so 40 is not a divisor of 1704)
- 1704 / 41 = 41.560975609756 (the remainder is 23, so 41 is not a divisor of 1704)