What are the divisors of 308?
1, 2, 4, 7, 11, 14, 22, 28, 44, 77, 154, 308
- There is a total of 12 positive divisors.
- The sum of these divisors is 672.
- The arithmetic mean is 56.
8 even divisors
2, 4, 14, 22, 28, 44, 154, 308
4 odd divisors
1, 7, 11, 77
How to compute the divisors of 308?
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 308 by each of the numbers from 1 to 308 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 308 / 1 = 308 (the remainder is 0, so 1 is a divisor of 308)
- 308 / 2 = 154 (the remainder is 0, so 2 is a divisor of 308)
- 308 / 3 = 102.66666666667 (the remainder is 2, so 3 is not a divisor of 308)
- ...
- 308 / 307 = 1.0032573289902 (the remainder is 1, so 307 is not a divisor of 308)
- 308 / 308 = 1 (the remainder is 0, so 308 is a divisor of 308)
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 308 (i.e. 17.549928774784). 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 )
- 308 / 1 = 308 (the remainder is 0, so 1 and 308 are divisors of 308)
- 308 / 2 = 154 (the remainder is 0, so 2 and 154 are divisors of 308)
- 308 / 3 = 102.66666666667 (the remainder is 2, so 3 is not a divisor of 308)
- ...
- 308 / 16 = 19.25 (the remainder is 4, so 16 is not a divisor of 308)
- 308 / 17 = 18.117647058824 (the remainder is 2, so 17 is not a divisor of 308)