What are the divisors of 1246?
1, 2, 7, 14, 89, 178, 623, 1246
- There is a total of 8 positive divisors.
- The sum of these divisors is 2160.
- The arithmetic mean is 270.
4 even divisors
2, 14, 178, 1246
4 odd divisors
1, 7, 89, 623
How to compute the divisors of 1246?
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 1246 by each of the numbers from 1 to 1246 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1246 / 1 = 1246 (the remainder is 0, so 1 is a divisor of 1246)
- 1246 / 2 = 623 (the remainder is 0, so 2 is a divisor of 1246)
- 1246 / 3 = 415.33333333333 (the remainder is 1, so 3 is not a divisor of 1246)
- ...
- 1246 / 1245 = 1.0008032128514 (the remainder is 1, so 1245 is not a divisor of 1246)
- 1246 / 1246 = 1 (the remainder is 0, so 1246 is a divisor of 1246)
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 1246 (i.e. 35.298725189446). 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 )
- 1246 / 1 = 1246 (the remainder is 0, so 1 and 1246 are divisors of 1246)
- 1246 / 2 = 623 (the remainder is 0, so 2 and 623 are divisors of 1246)
- 1246 / 3 = 415.33333333333 (the remainder is 1, so 3 is not a divisor of 1246)
- ...
- 1246 / 34 = 36.647058823529 (the remainder is 22, so 34 is not a divisor of 1246)
- 1246 / 35 = 35.6 (the remainder is 21, so 35 is not a divisor of 1246)