What are the divisors of 5946?
1, 2, 3, 6, 991, 1982, 2973, 5946
- There is a total of 8 positive divisors.
- The sum of these divisors is 11904.
- The arithmetic mean is 1488.
4 even divisors
2, 6, 1982, 5946
4 odd divisors
1, 3, 991, 2973
How to compute the divisors of 5946?
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 5946 by each of the numbers from 1 to 5946 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5946 / 1 = 5946 (the remainder is 0, so 1 is a divisor of 5946)
- 5946 / 2 = 2973 (the remainder is 0, so 2 is a divisor of 5946)
- 5946 / 3 = 1982 (the remainder is 0, so 3 is a divisor of 5946)
- ...
- 5946 / 5945 = 1.0001682085786 (the remainder is 1, so 5945 is not a divisor of 5946)
- 5946 / 5946 = 1 (the remainder is 0, so 5946 is a divisor of 5946)
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 5946 (i.e. 77.110310594628). 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 )
- 5946 / 1 = 5946 (the remainder is 0, so 1 and 5946 are divisors of 5946)
- 5946 / 2 = 2973 (the remainder is 0, so 2 and 2973 are divisors of 5946)
- 5946 / 3 = 1982 (the remainder is 0, so 3 and 1982 are divisors of 5946)
- ...
- 5946 / 76 = 78.236842105263 (the remainder is 18, so 76 is not a divisor of 5946)
- 5946 / 77 = 77.220779220779 (the remainder is 17, so 77 is not a divisor of 5946)