What are the divisors of 972?
1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 54, 81, 108, 162, 243, 324, 486, 972
- There is a total of 18 positive divisors.
- The sum of these divisors is 2548.
- The arithmetic mean is 141.55555555556.
12 even divisors
2, 4, 6, 12, 18, 36, 54, 108, 162, 324, 486, 972
6 odd divisors
1, 3, 9, 27, 81, 243
How to compute the divisors of 972?
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 972 by each of the numbers from 1 to 972 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 972 / 1 = 972 (the remainder is 0, so 1 is a divisor of 972)
- 972 / 2 = 486 (the remainder is 0, so 2 is a divisor of 972)
- 972 / 3 = 324 (the remainder is 0, so 3 is a divisor of 972)
- ...
- 972 / 971 = 1.0010298661174 (the remainder is 1, so 971 is not a divisor of 972)
- 972 / 972 = 1 (the remainder is 0, so 972 is a divisor of 972)
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 972 (i.e. 31.17691453624). 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 )
- 972 / 1 = 972 (the remainder is 0, so 1 and 972 are divisors of 972)
- 972 / 2 = 486 (the remainder is 0, so 2 and 486 are divisors of 972)
- 972 / 3 = 324 (the remainder is 0, so 3 and 324 are divisors of 972)
- ...
- 972 / 30 = 32.4 (the remainder is 12, so 30 is not a divisor of 972)
- 972 / 31 = 31.354838709677 (the remainder is 11, so 31 is not a divisor of 972)