What are the divisors of 1272?
1, 2, 3, 4, 6, 8, 12, 24, 53, 106, 159, 212, 318, 424, 636, 1272
- There is a total of 16 positive divisors.
- The sum of these divisors is 3240.
- The arithmetic mean is 202.5.
12 even divisors
2, 4, 6, 8, 12, 24, 106, 212, 318, 424, 636, 1272
4 odd divisors
1, 3, 53, 159
How to compute the divisors of 1272?
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 1272 by each of the numbers from 1 to 1272 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1272 / 1 = 1272 (the remainder is 0, so 1 is a divisor of 1272)
- 1272 / 2 = 636 (the remainder is 0, so 2 is a divisor of 1272)
- 1272 / 3 = 424 (the remainder is 0, so 3 is a divisor of 1272)
- ...
- 1272 / 1271 = 1.0007867820614 (the remainder is 1, so 1271 is not a divisor of 1272)
- 1272 / 1272 = 1 (the remainder is 0, so 1272 is a divisor of 1272)
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 1272 (i.e. 35.665109000254). 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 )
- 1272 / 1 = 1272 (the remainder is 0, so 1 and 1272 are divisors of 1272)
- 1272 / 2 = 636 (the remainder is 0, so 2 and 636 are divisors of 1272)
- 1272 / 3 = 424 (the remainder is 0, so 3 and 424 are divisors of 1272)
- ...
- 1272 / 34 = 37.411764705882 (the remainder is 14, so 34 is not a divisor of 1272)
- 1272 / 35 = 36.342857142857 (the remainder is 12, so 35 is not a divisor of 1272)