What are the divisors of 8128?
1, 2, 4, 8, 16, 32, 64, 127, 254, 508, 1016, 2032, 4064, 8128
- There is a total of 14 positive divisors.
- The sum of these divisors is 16256.
- The arithmetic mean is 1161.1428571429.
12 even divisors
2, 4, 8, 16, 32, 64, 254, 508, 1016, 2032, 4064, 8128
2 odd divisors
1, 127
How to compute the divisors of 8128?
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 8128 by each of the numbers from 1 to 8128 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 8128 / 1 = 8128 (the remainder is 0, so 1 is a divisor of 8128)
- 8128 / 2 = 4064 (the remainder is 0, so 2 is a divisor of 8128)
- 8128 / 3 = 2709.3333333333 (the remainder is 1, so 3 is not a divisor of 8128)
- ...
- 8128 / 8127 = 1.0001230466347 (the remainder is 1, so 8127 is not a divisor of 8128)
- 8128 / 8128 = 1 (the remainder is 0, so 8128 is a divisor of 8128)
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 8128 (i.e. 90.155421356677). 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 )
- 8128 / 1 = 8128 (the remainder is 0, so 1 and 8128 are divisors of 8128)
- 8128 / 2 = 4064 (the remainder is 0, so 2 and 4064 are divisors of 8128)
- 8128 / 3 = 2709.3333333333 (the remainder is 1, so 3 is not a divisor of 8128)
- ...
- 8128 / 89 = 91.325842696629 (the remainder is 29, so 89 is not a divisor of 8128)
- 8128 / 90 = 90.311111111111 (the remainder is 28, so 90 is not a divisor of 8128)