What are the divisors of 5994?
1, 2, 3, 6, 9, 18, 27, 37, 54, 74, 81, 111, 162, 222, 333, 666, 999, 1998, 2997, 5994
- There is a total of 20 positive divisors.
- The sum of these divisors is 13794.
- The arithmetic mean is 689.7.
10 even divisors
2, 6, 18, 54, 74, 162, 222, 666, 1998, 5994
10 odd divisors
1, 3, 9, 27, 37, 81, 111, 333, 999, 2997
How to compute the divisors of 5994?
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 5994 by each of the numbers from 1 to 5994 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5994 / 1 = 5994 (the remainder is 0, so 1 is a divisor of 5994)
- 5994 / 2 = 2997 (the remainder is 0, so 2 is a divisor of 5994)
- 5994 / 3 = 1998 (the remainder is 0, so 3 is a divisor of 5994)
- ...
- 5994 / 5993 = 1.0001668613382 (the remainder is 1, so 5993 is not a divisor of 5994)
- 5994 / 5994 = 1 (the remainder is 0, so 5994 is a divisor of 5994)
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 5994 (i.e. 77.420927403384). 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 )
- 5994 / 1 = 5994 (the remainder is 0, so 1 and 5994 are divisors of 5994)
- 5994 / 2 = 2997 (the remainder is 0, so 2 and 2997 are divisors of 5994)
- 5994 / 3 = 1998 (the remainder is 0, so 3 and 1998 are divisors of 5994)
- ...
- 5994 / 76 = 78.868421052632 (the remainder is 66, so 76 is not a divisor of 5994)
- 5994 / 77 = 77.844155844156 (the remainder is 65, so 77 is not a divisor of 5994)