What are the divisors of 664?
1, 2, 4, 8, 83, 166, 332, 664
- There is a total of 8 positive divisors.
- The sum of these divisors is 1260.
- The arithmetic mean is 157.5.
6 even divisors
2, 4, 8, 166, 332, 664
2 odd divisors
1, 83
How to compute the divisors of 664?
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 664 by each of the numbers from 1 to 664 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 664 / 1 = 664 (the remainder is 0, so 1 is a divisor of 664)
- 664 / 2 = 332 (the remainder is 0, so 2 is a divisor of 664)
- 664 / 3 = 221.33333333333 (the remainder is 1, so 3 is not a divisor of 664)
- ...
- 664 / 663 = 1.0015082956259 (the remainder is 1, so 663 is not a divisor of 664)
- 664 / 664 = 1 (the remainder is 0, so 664 is a divisor of 664)
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 664 (i.e. 25.76819745345). 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 )
- 664 / 1 = 664 (the remainder is 0, so 1 and 664 are divisors of 664)
- 664 / 2 = 332 (the remainder is 0, so 2 and 332 are divisors of 664)
- 664 / 3 = 221.33333333333 (the remainder is 1, so 3 is not a divisor of 664)
- ...
- 664 / 24 = 27.666666666667 (the remainder is 16, so 24 is not a divisor of 664)
- 664 / 25 = 26.56 (the remainder is 14, so 25 is not a divisor of 664)