What are the divisors of 115?
1, 5, 23, 115
- There is a total of 4 positive divisors.
- The sum of these divisors is 144.
- The arithmetic mean is 36.
4 odd divisors
1, 5, 23, 115
How to compute the divisors of 115?
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 115 by each of the numbers from 1 to 115 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 115 / 1 = 115 (the remainder is 0, so 1 is a divisor of 115)
- 115 / 2 = 57.5 (the remainder is 1, so 2 is not a divisor of 115)
- 115 / 3 = 38.333333333333 (the remainder is 1, so 3 is not a divisor of 115)
- ...
- 115 / 114 = 1.0087719298246 (the remainder is 1, so 114 is not a divisor of 115)
- 115 / 115 = 1 (the remainder is 0, so 115 is a divisor of 115)
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 115 (i.e. 10.723805294764). 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 )
- 115 / 1 = 115 (the remainder is 0, so 1 and 115 are divisors of 115)
- 115 / 2 = 57.5 (the remainder is 1, so 2 is not a divisor of 115)
- 115 / 3 = 38.333333333333 (the remainder is 1, so 3 is not a divisor of 115)
- ...
- 115 / 9 = 12.777777777778 (the remainder is 7, so 9 is not a divisor of 115)
- 115 / 10 = 11.5 (the remainder is 5, so 10 is not a divisor of 115)