What are the divisors of 129?
1, 3, 43, 129
- There is a total of 4 positive divisors.
- The sum of these divisors is 176.
- The arithmetic mean is 44.
4 odd divisors
1, 3, 43, 129
How to compute the divisors of 129?
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 129 by each of the numbers from 1 to 129 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 129 / 1 = 129 (the remainder is 0, so 1 is a divisor of 129)
- 129 / 2 = 64.5 (the remainder is 1, so 2 is not a divisor of 129)
- 129 / 3 = 43 (the remainder is 0, so 3 is a divisor of 129)
- ...
- 129 / 128 = 1.0078125 (the remainder is 1, so 128 is not a divisor of 129)
- 129 / 129 = 1 (the remainder is 0, so 129 is a divisor of 129)
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 129 (i.e. 11.357816691601). 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 )
- 129 / 1 = 129 (the remainder is 0, so 1 and 129 are divisors of 129)
- 129 / 2 = 64.5 (the remainder is 1, so 2 is not a divisor of 129)
- 129 / 3 = 43 (the remainder is 0, so 3 and 43 are divisors of 129)
- ...
- 129 / 10 = 12.9 (the remainder is 9, so 10 is not a divisor of 129)
- 129 / 11 = 11.727272727273 (the remainder is 8, so 11 is not a divisor of 129)