What are the divisors of 864?
1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 72, 96, 108, 144, 216, 288, 432, 864
- There is a total of 24 positive divisors.
- The sum of these divisors is 2520.
- The arithmetic mean is 105.
20 even divisors
2, 4, 6, 8, 12, 16, 18, 24, 32, 36, 48, 54, 72, 96, 108, 144, 216, 288, 432, 864
4 odd divisors
1, 3, 9, 27
How to compute the divisors of 864?
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 864 by each of the numbers from 1 to 864 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 864 / 1 = 864 (the remainder is 0, so 1 is a divisor of 864)
- 864 / 2 = 432 (the remainder is 0, so 2 is a divisor of 864)
- 864 / 3 = 288 (the remainder is 0, so 3 is a divisor of 864)
- ...
- 864 / 863 = 1.0011587485516 (the remainder is 1, so 863 is not a divisor of 864)
- 864 / 864 = 1 (the remainder is 0, so 864 is a divisor of 864)
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 864 (i.e. 29.393876913398). 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 )
- 864 / 1 = 864 (the remainder is 0, so 1 and 864 are divisors of 864)
- 864 / 2 = 432 (the remainder is 0, so 2 and 432 are divisors of 864)
- 864 / 3 = 288 (the remainder is 0, so 3 and 288 are divisors of 864)
- ...
- 864 / 28 = 30.857142857143 (the remainder is 24, so 28 is not a divisor of 864)
- 864 / 29 = 29.793103448276 (the remainder is 23, so 29 is not a divisor of 864)