What are the divisors of 2979?
1, 3, 9, 331, 993, 2979
- There is a total of 6 positive divisors.
- The sum of these divisors is 4316.
- The arithmetic mean is 719.33333333333.
6 odd divisors
1, 3, 9, 331, 993, 2979
How to compute the divisors of 2979?
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 2979 by each of the numbers from 1 to 2979 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 2979 / 1 = 2979 (the remainder is 0, so 1 is a divisor of 2979)
- 2979 / 2 = 1489.5 (the remainder is 1, so 2 is not a divisor of 2979)
- 2979 / 3 = 993 (the remainder is 0, so 3 is a divisor of 2979)
- ...
- 2979 / 2978 = 1.0003357958361 (the remainder is 1, so 2978 is not a divisor of 2979)
- 2979 / 2979 = 1 (the remainder is 0, so 2979 is a divisor of 2979)
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 2979 (i.e. 54.580216195981). 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 )
- 2979 / 1 = 2979 (the remainder is 0, so 1 and 2979 are divisors of 2979)
- 2979 / 2 = 1489.5 (the remainder is 1, so 2 is not a divisor of 2979)
- 2979 / 3 = 993 (the remainder is 0, so 3 and 993 are divisors of 2979)
- ...
- 2979 / 53 = 56.207547169811 (the remainder is 11, so 53 is not a divisor of 2979)
- 2979 / 54 = 55.166666666667 (the remainder is 9, so 54 is not a divisor of 2979)