What are the divisors of 8127?
1, 3, 7, 9, 21, 27, 43, 63, 129, 189, 301, 387, 903, 1161, 2709, 8127
- There is a total of 16 positive divisors.
- The sum of these divisors is 14080.
- The arithmetic mean is 880.
16 odd divisors
1, 3, 7, 9, 21, 27, 43, 63, 129, 189, 301, 387, 903, 1161, 2709, 8127
How to compute the divisors of 8127?
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 8127 by each of the numbers from 1 to 8127 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 8127 / 1 = 8127 (the remainder is 0, so 1 is a divisor of 8127)
- 8127 / 2 = 4063.5 (the remainder is 1, so 2 is not a divisor of 8127)
- 8127 / 3 = 2709 (the remainder is 0, so 3 is a divisor of 8127)
- ...
- 8127 / 8126 = 1.000123061777 (the remainder is 1, so 8126 is not a divisor of 8127)
- 8127 / 8127 = 1 (the remainder is 0, so 8127 is a divisor of 8127)
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 8127 (i.e. 90.1498752079). 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 )
- 8127 / 1 = 8127 (the remainder is 0, so 1 and 8127 are divisors of 8127)
- 8127 / 2 = 4063.5 (the remainder is 1, so 2 is not a divisor of 8127)
- 8127 / 3 = 2709 (the remainder is 0, so 3 and 2709 are divisors of 8127)
- ...
- 8127 / 89 = 91.314606741573 (the remainder is 28, so 89 is not a divisor of 8127)
- 8127 / 90 = 90.3 (the remainder is 27, so 90 is not a divisor of 8127)