What are the divisors of 1958?
1, 2, 11, 22, 89, 178, 979, 1958
- There is a total of 8 positive divisors.
- The sum of these divisors is 3240.
- The arithmetic mean is 405.
4 even divisors
2, 22, 178, 1958
4 odd divisors
1, 11, 89, 979
How to compute the divisors of 1958?
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 1958 by each of the numbers from 1 to 1958 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1958 / 1 = 1958 (the remainder is 0, so 1 is a divisor of 1958)
- 1958 / 2 = 979 (the remainder is 0, so 2 is a divisor of 1958)
- 1958 / 3 = 652.66666666667 (the remainder is 2, so 3 is not a divisor of 1958)
- ...
- 1958 / 1957 = 1.0005109862034 (the remainder is 1, so 1957 is not a divisor of 1958)
- 1958 / 1958 = 1 (the remainder is 0, so 1958 is a divisor of 1958)
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 1958 (i.e. 44.249293779675). 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 )
- 1958 / 1 = 1958 (the remainder is 0, so 1 and 1958 are divisors of 1958)
- 1958 / 2 = 979 (the remainder is 0, so 2 and 979 are divisors of 1958)
- 1958 / 3 = 652.66666666667 (the remainder is 2, so 3 is not a divisor of 1958)
- ...
- 1958 / 43 = 45.53488372093 (the remainder is 23, so 43 is not a divisor of 1958)
- 1958 / 44 = 44.5 (the remainder is 22, so 44 is not a divisor of 1958)