What are the divisors of 2997?
1, 3, 9, 27, 37, 81, 111, 333, 999, 2997
- There is a total of 10 positive divisors.
- The sum of these divisors is 4598.
- The arithmetic mean is 459.8.
10 odd divisors
1, 3, 9, 27, 37, 81, 111, 333, 999, 2997
How to compute the divisors of 2997?
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 2997 by each of the numbers from 1 to 2997 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 2997 / 1 = 2997 (the remainder is 0, so 1 is a divisor of 2997)
- 2997 / 2 = 1498.5 (the remainder is 1, so 2 is not a divisor of 2997)
- 2997 / 3 = 999 (the remainder is 0, so 3 is a divisor of 2997)
- ...
- 2997 / 2996 = 1.0003337783712 (the remainder is 1, so 2996 is not a divisor of 2997)
- 2997 / 2997 = 1 (the remainder is 0, so 2997 is a divisor of 2997)
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 2997 (i.e. 54.744862772684). 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 )
- 2997 / 1 = 2997 (the remainder is 0, so 1 and 2997 are divisors of 2997)
- 2997 / 2 = 1498.5 (the remainder is 1, so 2 is not a divisor of 2997)
- 2997 / 3 = 999 (the remainder is 0, so 3 and 999 are divisors of 2997)
- ...
- 2997 / 53 = 56.547169811321 (the remainder is 29, so 53 is not a divisor of 2997)
- 2997 / 54 = 55.5 (the remainder is 27, so 54 is not a divisor of 2997)