What are the divisors of 3122?
1, 2, 7, 14, 223, 446, 1561, 3122
- There is a total of 8 positive divisors.
- The sum of these divisors is 5376.
- The arithmetic mean is 672.
4 even divisors
2, 14, 446, 3122
4 odd divisors
1, 7, 223, 1561
How to compute the divisors of 3122?
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 3122 by each of the numbers from 1 to 3122 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 3122 / 1 = 3122 (the remainder is 0, so 1 is a divisor of 3122)
- 3122 / 2 = 1561 (the remainder is 0, so 2 is a divisor of 3122)
- 3122 / 3 = 1040.6666666667 (the remainder is 2, so 3 is not a divisor of 3122)
- ...
- 3122 / 3121 = 1.000320410125 (the remainder is 1, so 3121 is not a divisor of 3122)
- 3122 / 3122 = 1 (the remainder is 0, so 3122 is a divisor of 3122)
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 3122 (i.e. 55.874860178796). 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 )
- 3122 / 1 = 3122 (the remainder is 0, so 1 and 3122 are divisors of 3122)
- 3122 / 2 = 1561 (the remainder is 0, so 2 and 1561 are divisors of 3122)
- 3122 / 3 = 1040.6666666667 (the remainder is 2, so 3 is not a divisor of 3122)
- ...
- 3122 / 54 = 57.814814814815 (the remainder is 44, so 54 is not a divisor of 3122)
- 3122 / 55 = 56.763636363636 (the remainder is 42, so 55 is not a divisor of 3122)