What are the divisors of 954?
1, 2, 3, 6, 9, 18, 53, 106, 159, 318, 477, 954
- There is a total of 12 positive divisors.
- The sum of these divisors is 2106.
- The arithmetic mean is 175.5.
6 even divisors
2, 6, 18, 106, 318, 954
6 odd divisors
1, 3, 9, 53, 159, 477
How to compute the divisors of 954?
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 954 by each of the numbers from 1 to 954 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 954 / 1 = 954 (the remainder is 0, so 1 is a divisor of 954)
- 954 / 2 = 477 (the remainder is 0, so 2 is a divisor of 954)
- 954 / 3 = 318 (the remainder is 0, so 3 is a divisor of 954)
- ...
- 954 / 953 = 1.0010493179433 (the remainder is 1, so 953 is not a divisor of 954)
- 954 / 954 = 1 (the remainder is 0, so 954 is a divisor of 954)
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 954 (i.e. 30.886890422961). 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 )
- 954 / 1 = 954 (the remainder is 0, so 1 and 954 are divisors of 954)
- 954 / 2 = 477 (the remainder is 0, so 2 and 477 are divisors of 954)
- 954 / 3 = 318 (the remainder is 0, so 3 and 318 are divisors of 954)
- ...
- 954 / 29 = 32.896551724138 (the remainder is 26, so 29 is not a divisor of 954)
- 954 / 30 = 31.8 (the remainder is 24, so 30 is not a divisor of 954)