What are the divisors of 1182?
1, 2, 3, 6, 197, 394, 591, 1182
- There is a total of 8 positive divisors.
- The sum of these divisors is 2376.
- The arithmetic mean is 297.
4 even divisors
2, 6, 394, 1182
4 odd divisors
1, 3, 197, 591
How to compute the divisors of 1182?
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 1182 by each of the numbers from 1 to 1182 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1182 / 1 = 1182 (the remainder is 0, so 1 is a divisor of 1182)
- 1182 / 2 = 591 (the remainder is 0, so 2 is a divisor of 1182)
- 1182 / 3 = 394 (the remainder is 0, so 3 is a divisor of 1182)
- ...
- 1182 / 1181 = 1.0008467400508 (the remainder is 1, so 1181 is not a divisor of 1182)
- 1182 / 1182 = 1 (the remainder is 0, so 1182 is a divisor of 1182)
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 1182 (i.e. 34.380226875342). 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 )
- 1182 / 1 = 1182 (the remainder is 0, so 1 and 1182 are divisors of 1182)
- 1182 / 2 = 591 (the remainder is 0, so 2 and 591 are divisors of 1182)
- 1182 / 3 = 394 (the remainder is 0, so 3 and 394 are divisors of 1182)
- ...
- 1182 / 33 = 35.818181818182 (the remainder is 27, so 33 is not a divisor of 1182)
- 1182 / 34 = 34.764705882353 (the remainder is 26, so 34 is not a divisor of 1182)