What are the divisors of 196?
1, 2, 4, 7, 14, 28, 49, 98, 196
- There is a total of 9 positive divisors.
- The sum of these divisors is 399.
- The arithmetic mean is 44.333333333333.
6 even divisors
2, 4, 14, 28, 98, 196
3 odd divisors
1, 7, 49
How to compute the divisors of 196?
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 196 by each of the numbers from 1 to 196 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 196 / 1 = 196 (the remainder is 0, so 1 is a divisor of 196)
- 196 / 2 = 98 (the remainder is 0, so 2 is a divisor of 196)
- 196 / 3 = 65.333333333333 (the remainder is 1, so 3 is not a divisor of 196)
- ...
- 196 / 195 = 1.0051282051282 (the remainder is 1, so 195 is not a divisor of 196)
- 196 / 196 = 1 (the remainder is 0, so 196 is a divisor of 196)
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 196 (i.e. 14). 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 )
- 196 / 1 = 196 (the remainder is 0, so 1 and 196 are divisors of 196)
- 196 / 2 = 98 (the remainder is 0, so 2 and 98 are divisors of 196)
- 196 / 3 = 65.333333333333 (the remainder is 1, so 3 is not a divisor of 196)
- ...
- 196 / 13 = 15.076923076923 (the remainder is 1, so 13 is not a divisor of 196)
- 196 / 14 = 14 (the remainder is 0, so 14 and 14 are divisors of 196)