What are the divisors of 1178?
1, 2, 19, 31, 38, 62, 589, 1178
- There is a total of 8 positive divisors.
- The sum of these divisors is 1920.
- The arithmetic mean is 240.
4 even divisors
2, 38, 62, 1178
4 odd divisors
1, 19, 31, 589
How to compute the divisors of 1178?
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 1178 by each of the numbers from 1 to 1178 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1178 / 1 = 1178 (the remainder is 0, so 1 is a divisor of 1178)
- 1178 / 2 = 589 (the remainder is 0, so 2 is a divisor of 1178)
- 1178 / 3 = 392.66666666667 (the remainder is 2, so 3 is not a divisor of 1178)
- ...
- 1178 / 1177 = 1.000849617672 (the remainder is 1, so 1177 is not a divisor of 1178)
- 1178 / 1178 = 1 (the remainder is 0, so 1178 is a divisor of 1178)
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 1178 (i.e. 34.322004603461). 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 )
- 1178 / 1 = 1178 (the remainder is 0, so 1 and 1178 are divisors of 1178)
- 1178 / 2 = 589 (the remainder is 0, so 2 and 589 are divisors of 1178)
- 1178 / 3 = 392.66666666667 (the remainder is 2, so 3 is not a divisor of 1178)
- ...
- 1178 / 33 = 35.69696969697 (the remainder is 23, so 33 is not a divisor of 1178)
- 1178 / 34 = 34.647058823529 (the remainder is 22, so 34 is not a divisor of 1178)