What are the divisors of 1232?
1, 2, 4, 7, 8, 11, 14, 16, 22, 28, 44, 56, 77, 88, 112, 154, 176, 308, 616, 1232
- There is a total of 20 positive divisors.
- The sum of these divisors is 2976.
- The arithmetic mean is 148.8.
16 even divisors
2, 4, 8, 14, 16, 22, 28, 44, 56, 88, 112, 154, 176, 308, 616, 1232
4 odd divisors
1, 7, 11, 77
How to compute the divisors of 1232?
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 1232 by each of the numbers from 1 to 1232 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1232 / 1 = 1232 (the remainder is 0, so 1 is a divisor of 1232)
- 1232 / 2 = 616 (the remainder is 0, so 2 is a divisor of 1232)
- 1232 / 3 = 410.66666666667 (the remainder is 2, so 3 is not a divisor of 1232)
- ...
- 1232 / 1231 = 1.0008123476848 (the remainder is 1, so 1231 is not a divisor of 1232)
- 1232 / 1232 = 1 (the remainder is 0, so 1232 is a divisor of 1232)
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 1232 (i.e. 35.099857549568). 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 )
- 1232 / 1 = 1232 (the remainder is 0, so 1 and 1232 are divisors of 1232)
- 1232 / 2 = 616 (the remainder is 0, so 2 and 616 are divisors of 1232)
- 1232 / 3 = 410.66666666667 (the remainder is 2, so 3 is not a divisor of 1232)
- ...
- 1232 / 34 = 36.235294117647 (the remainder is 8, so 34 is not a divisor of 1232)
- 1232 / 35 = 35.2 (the remainder is 7, so 35 is not a divisor of 1232)