What are the divisors of 25?
1, 5, 25
- There is a total of 3 positive divisors.
- The sum of these divisors is 31.
- The arithmetic mean is 10.333333333333.
3 odd divisors
1, 5, 25
How to compute the divisors of 25?
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 25 by each of the numbers from 1 to 25 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 25 / 1 = 25 (the remainder is 0, so 1 is a divisor of 25)
- 25 / 2 = 12.5 (the remainder is 1, so 2 is not a divisor of 25)
- 25 / 3 = 8.3333333333333 (the remainder is 1, so 3 is not a divisor of 25)
- ...
- 25 / 4 = 6.25 (the remainder is 1, so 4 is not a divisor of 25)
- 25 / 5 = 5 (the remainder is 0, so 5 is a divisor of 25)
- 25 / 6 = 4.1666666666667 (the remainder is 1, so 6 is not a divisor of 25)
- 25 / 7 = 3.5714285714286 (the remainder is 4, so 7 is not a divisor of 25)
- 25 / 8 = 3.125 (the remainder is 1, so 8 is not a divisor of 25)
- 25 / 9 = 2.7777777777778 (the remainder is 7, so 9 is not a divisor of 25)
- 25 / 10 = 2.5 (the remainder is 5, so 10 is not a divisor of 25)
- 25 / 11 = 2.2727272727273 (the remainder is 3, so 11 is not a divisor of 25)
- 25 / 12 = 2.0833333333333 (the remainder is 1, so 12 is not a divisor of 25)
- 25 / 13 = 1.9230769230769 (the remainder is 12, so 13 is not a divisor of 25)
- 25 / 14 = 1.7857142857143 (the remainder is 11, so 14 is not a divisor of 25)
- 25 / 15 = 1.6666666666667 (the remainder is 10, so 15 is not a divisor of 25)
- 25 / 16 = 1.5625 (the remainder is 9, so 16 is not a divisor of 25)
- 25 / 17 = 1.4705882352941 (the remainder is 8, so 17 is not a divisor of 25)
- 25 / 18 = 1.3888888888889 (the remainder is 7, so 18 is not a divisor of 25)
- 25 / 19 = 1.3157894736842 (the remainder is 6, so 19 is not a divisor of 25)
- 25 / 20 = 1.25 (the remainder is 5, so 20 is not a divisor of 25)
- 25 / 21 = 1.1904761904762 (the remainder is 4, so 21 is not a divisor of 25)
- 25 / 22 = 1.1363636363636 (the remainder is 3, so 22 is not a divisor of 25)
- 25 / 23 = 1.0869565217391 (the remainder is 2, so 23 is not a divisor of 25)
- 25 / 24 = 1.0416666666667 (the remainder is 1, so 24 is not a divisor of 25)
- 25 / 25 = 1 (the remainder is 0, so 25 is a divisor of 25)
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 25 (i.e. 5). 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 )
- 25 / 1 = 25 (the remainder is 0, so 1 and 25 are divisors of 25)
- 25 / 2 = 12.5 (the remainder is 1, so 2 is not a divisor of 25)
- 25 / 3 = 8.3333333333333 (the remainder is 1, so 3 is not a divisor of 25)
- ...
- 25 / 4 = 6.25 (the remainder is 1, so 4 is not a divisor of 25)
- 25 / 5 = 5 (the remainder is 0, so 5 and 5 are divisors of 25)