What are the divisors of 1248?
1, 2, 3, 4, 6, 8, 12, 13, 16, 24, 26, 32, 39, 48, 52, 78, 96, 104, 156, 208, 312, 416, 624, 1248
- There is a total of 24 positive divisors.
- The sum of these divisors is 3528.
- The arithmetic mean is 147.
20 even divisors
2, 4, 6, 8, 12, 16, 24, 26, 32, 48, 52, 78, 96, 104, 156, 208, 312, 416, 624, 1248
4 odd divisors
1, 3, 13, 39
How to compute the divisors of 1248?
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 1248 by each of the numbers from 1 to 1248 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1248 / 1 = 1248 (the remainder is 0, so 1 is a divisor of 1248)
- 1248 / 2 = 624 (the remainder is 0, so 2 is a divisor of 1248)
- 1248 / 3 = 416 (the remainder is 0, so 3 is a divisor of 1248)
- ...
- 1248 / 1247 = 1.0008019246191 (the remainder is 1, so 1247 is not a divisor of 1248)
- 1248 / 1248 = 1 (the remainder is 0, so 1248 is a divisor of 1248)
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 1248 (i.e. 35.327043465311). 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 )
- 1248 / 1 = 1248 (the remainder is 0, so 1 and 1248 are divisors of 1248)
- 1248 / 2 = 624 (the remainder is 0, so 2 and 624 are divisors of 1248)
- 1248 / 3 = 416 (the remainder is 0, so 3 and 416 are divisors of 1248)
- ...
- 1248 / 34 = 36.705882352941 (the remainder is 24, so 34 is not a divisor of 1248)
- 1248 / 35 = 35.657142857143 (the remainder is 23, so 35 is not a divisor of 1248)