What are the divisors of 1140?
1, 2, 3, 4, 5, 6, 10, 12, 15, 19, 20, 30, 38, 57, 60, 76, 95, 114, 190, 228, 285, 380, 570, 1140
- There is a total of 24 positive divisors.
- The sum of these divisors is 3360.
- The arithmetic mean is 140.
16 even divisors
2, 4, 6, 10, 12, 20, 30, 38, 60, 76, 114, 190, 228, 380, 570, 1140
8 odd divisors
1, 3, 5, 15, 19, 57, 95, 285
How to compute the divisors of 1140?
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 1140 by each of the numbers from 1 to 1140 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1140 / 1 = 1140 (the remainder is 0, so 1 is a divisor of 1140)
- 1140 / 2 = 570 (the remainder is 0, so 2 is a divisor of 1140)
- 1140 / 3 = 380 (the remainder is 0, so 3 is a divisor of 1140)
- ...
- 1140 / 1139 = 1.0008779631255 (the remainder is 1, so 1139 is not a divisor of 1140)
- 1140 / 1140 = 1 (the remainder is 0, so 1140 is a divisor of 1140)
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 1140 (i.e. 33.763886032268). 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 )
- 1140 / 1 = 1140 (the remainder is 0, so 1 and 1140 are divisors of 1140)
- 1140 / 2 = 570 (the remainder is 0, so 2 and 570 are divisors of 1140)
- 1140 / 3 = 380 (the remainder is 0, so 3 and 380 are divisors of 1140)
- ...
- 1140 / 32 = 35.625 (the remainder is 20, so 32 is not a divisor of 1140)
- 1140 / 33 = 34.545454545455 (the remainder is 18, so 33 is not a divisor of 1140)