What are the divisors of 302?
1, 2, 151, 302
- There is a total of 4 positive divisors.
- The sum of these divisors is 456.
- The arithmetic mean is 114.
2 even divisors
2, 302
2 odd divisors
1, 151
How to compute the divisors of 302?
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 302 by each of the numbers from 1 to 302 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 302 / 1 = 302 (the remainder is 0, so 1 is a divisor of 302)
- 302 / 2 = 151 (the remainder is 0, so 2 is a divisor of 302)
- 302 / 3 = 100.66666666667 (the remainder is 2, so 3 is not a divisor of 302)
- ...
- 302 / 301 = 1.0033222591362 (the remainder is 1, so 301 is not a divisor of 302)
- 302 / 302 = 1 (the remainder is 0, so 302 is a divisor of 302)
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 302 (i.e. 17.378147196983). 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 )
- 302 / 1 = 302 (the remainder is 0, so 1 and 302 are divisors of 302)
- 302 / 2 = 151 (the remainder is 0, so 2 and 151 are divisors of 302)
- 302 / 3 = 100.66666666667 (the remainder is 2, so 3 is not a divisor of 302)
- ...
- 302 / 16 = 18.875 (the remainder is 14, so 16 is not a divisor of 302)
- 302 / 17 = 17.764705882353 (the remainder is 13, so 17 is not a divisor of 302)