What are the divisors of 1212?
1, 2, 3, 4, 6, 12, 101, 202, 303, 404, 606, 1212
- There is a total of 12 positive divisors.
- The sum of these divisors is 2856.
- The arithmetic mean is 238.
8 even divisors
2, 4, 6, 12, 202, 404, 606, 1212
4 odd divisors
1, 3, 101, 303
How to compute the divisors of 1212?
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 1212 by each of the numbers from 1 to 1212 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1212 / 1 = 1212 (the remainder is 0, so 1 is a divisor of 1212)
- 1212 / 2 = 606 (the remainder is 0, so 2 is a divisor of 1212)
- 1212 / 3 = 404 (the remainder is 0, so 3 is a divisor of 1212)
- ...
- 1212 / 1211 = 1.0008257638315 (the remainder is 1, so 1211 is not a divisor of 1212)
- 1212 / 1212 = 1 (the remainder is 0, so 1212 is a divisor of 1212)
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 1212 (i.e. 34.813790371058). 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 )
- 1212 / 1 = 1212 (the remainder is 0, so 1 and 1212 are divisors of 1212)
- 1212 / 2 = 606 (the remainder is 0, so 2 and 606 are divisors of 1212)
- 1212 / 3 = 404 (the remainder is 0, so 3 and 404 are divisors of 1212)
- ...
- 1212 / 33 = 36.727272727273 (the remainder is 24, so 33 is not a divisor of 1212)
- 1212 / 34 = 35.647058823529 (the remainder is 22, so 34 is not a divisor of 1212)