What are the divisors of 96?
1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 96
- There is a total of 12 positive divisors.
- The sum of these divisors is 252.
- The arithmetic mean is 21.
10 even divisors
2, 4, 6, 8, 12, 16, 24, 32, 48, 96
2 odd divisors
1, 3
How to compute the divisors of 96?
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 96 by each of the numbers from 1 to 96 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 96 / 1 = 96 (the remainder is 0, so 1 is a divisor of 96)
- 96 / 2 = 48 (the remainder is 0, so 2 is a divisor of 96)
- 96 / 3 = 32 (the remainder is 0, so 3 is a divisor of 96)
- ...
- 96 / 95 = 1.0105263157895 (the remainder is 1, so 95 is not a divisor of 96)
- 96 / 96 = 1 (the remainder is 0, so 96 is a divisor of 96)
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 96 (i.e. 9.7979589711327). 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 )
- 96 / 1 = 96 (the remainder is 0, so 1 and 96 are divisors of 96)
- 96 / 2 = 48 (the remainder is 0, so 2 and 48 are divisors of 96)
- 96 / 3 = 32 (the remainder is 0, so 3 and 32 are divisors of 96)
- ...
- 96 / 8 = 12 (the remainder is 0, so 8 and 12 are divisors of 96)
- 96 / 9 = 10.666666666667 (the remainder is 6, so 9 is not a divisor of 96)