What are the divisors of 8138?
1, 2, 13, 26, 313, 626, 4069, 8138
- There is a total of 8 positive divisors.
- The sum of these divisors is 13188.
- The arithmetic mean is 1648.5.
4 even divisors
2, 26, 626, 8138
4 odd divisors
1, 13, 313, 4069
How to compute the divisors of 8138?
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 8138 by each of the numbers from 1 to 8138 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 8138 / 1 = 8138 (the remainder is 0, so 1 is a divisor of 8138)
- 8138 / 2 = 4069 (the remainder is 0, so 2 is a divisor of 8138)
- 8138 / 3 = 2712.6666666667 (the remainder is 2, so 3 is not a divisor of 8138)
- ...
- 8138 / 8137 = 1.000122895416 (the remainder is 1, so 8137 is not a divisor of 8138)
- 8138 / 8138 = 1 (the remainder is 0, so 8138 is a divisor of 8138)
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 8138 (i.e. 90.210864090751). 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 )
- 8138 / 1 = 8138 (the remainder is 0, so 1 and 8138 are divisors of 8138)
- 8138 / 2 = 4069 (the remainder is 0, so 2 and 4069 are divisors of 8138)
- 8138 / 3 = 2712.6666666667 (the remainder is 2, so 3 is not a divisor of 8138)
- ...
- 8138 / 89 = 91.438202247191 (the remainder is 39, so 89 is not a divisor of 8138)
- 8138 / 90 = 90.422222222222 (the remainder is 38, so 90 is not a divisor of 8138)