What are the divisors of 654?
1, 2, 3, 6, 109, 218, 327, 654
- There is a total of 8 positive divisors.
- The sum of these divisors is 1320.
- The arithmetic mean is 165.
4 even divisors
2, 6, 218, 654
4 odd divisors
1, 3, 109, 327
How to compute the divisors of 654?
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 654 by each of the numbers from 1 to 654 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 654 / 1 = 654 (the remainder is 0, so 1 is a divisor of 654)
- 654 / 2 = 327 (the remainder is 0, so 2 is a divisor of 654)
- 654 / 3 = 218 (the remainder is 0, so 3 is a divisor of 654)
- ...
- 654 / 653 = 1.0015313935681 (the remainder is 1, so 653 is not a divisor of 654)
- 654 / 654 = 1 (the remainder is 0, so 654 is a divisor of 654)
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 654 (i.e. 25.573423705089). 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 )
- 654 / 1 = 654 (the remainder is 0, so 1 and 654 are divisors of 654)
- 654 / 2 = 327 (the remainder is 0, so 2 and 327 are divisors of 654)
- 654 / 3 = 218 (the remainder is 0, so 3 and 218 are divisors of 654)
- ...
- 654 / 24 = 27.25 (the remainder is 6, so 24 is not a divisor of 654)
- 654 / 25 = 26.16 (the remainder is 4, so 25 is not a divisor of 654)