What are the divisors of 1666?
1, 2, 7, 14, 17, 34, 49, 98, 119, 238, 833, 1666
- There is a total of 12 positive divisors.
- The sum of these divisors is 3078.
- The arithmetic mean is 256.5.
6 even divisors
2, 14, 34, 98, 238, 1666
6 odd divisors
1, 7, 17, 49, 119, 833
How to compute the divisors of 1666?
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 1666 by each of the numbers from 1 to 1666 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1666 / 1 = 1666 (the remainder is 0, so 1 is a divisor of 1666)
- 1666 / 2 = 833 (the remainder is 0, so 2 is a divisor of 1666)
- 1666 / 3 = 555.33333333333 (the remainder is 1, so 3 is not a divisor of 1666)
- ...
- 1666 / 1665 = 1.0006006006006 (the remainder is 1, so 1665 is not a divisor of 1666)
- 1666 / 1666 = 1 (the remainder is 0, so 1666 is a divisor of 1666)
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 1666 (i.e. 40.816663263917). 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 )
- 1666 / 1 = 1666 (the remainder is 0, so 1 and 1666 are divisors of 1666)
- 1666 / 2 = 833 (the remainder is 0, so 2 and 833 are divisors of 1666)
- 1666 / 3 = 555.33333333333 (the remainder is 1, so 3 is not a divisor of 1666)
- ...
- 1666 / 39 = 42.717948717949 (the remainder is 28, so 39 is not a divisor of 1666)
- 1666 / 40 = 41.65 (the remainder is 26, so 40 is not a divisor of 1666)