What are the divisors of 1284?
1, 2, 3, 4, 6, 12, 107, 214, 321, 428, 642, 1284
- There is a total of 12 positive divisors.
- The sum of these divisors is 3024.
- The arithmetic mean is 252.
8 even divisors
2, 4, 6, 12, 214, 428, 642, 1284
4 odd divisors
1, 3, 107, 321
How to compute the divisors of 1284?
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 1284 by each of the numbers from 1 to 1284 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1284 / 1 = 1284 (the remainder is 0, so 1 is a divisor of 1284)
- 1284 / 2 = 642 (the remainder is 0, so 2 is a divisor of 1284)
- 1284 / 3 = 428 (the remainder is 0, so 3 is a divisor of 1284)
- ...
- 1284 / 1283 = 1.0007794232268 (the remainder is 1, so 1283 is not a divisor of 1284)
- 1284 / 1284 = 1 (the remainder is 0, so 1284 is a divisor of 1284)
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 1284 (i.e. 35.832945734338). 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 )
- 1284 / 1 = 1284 (the remainder is 0, so 1 and 1284 are divisors of 1284)
- 1284 / 2 = 642 (the remainder is 0, so 2 and 642 are divisors of 1284)
- 1284 / 3 = 428 (the remainder is 0, so 3 and 428 are divisors of 1284)
- ...
- 1284 / 34 = 37.764705882353 (the remainder is 26, so 34 is not a divisor of 1284)
- 1284 / 35 = 36.685714285714 (the remainder is 24, so 35 is not a divisor of 1284)