What are the divisors of 142?
1, 2, 71, 142
- There is a total of 4 positive divisors.
- The sum of these divisors is 216.
- The arithmetic mean is 54.
2 even divisors
2, 142
2 odd divisors
1, 71
How to compute the divisors of 142?
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 142 by each of the numbers from 1 to 142 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 142 / 1 = 142 (the remainder is 0, so 1 is a divisor of 142)
- 142 / 2 = 71 (the remainder is 0, so 2 is a divisor of 142)
- 142 / 3 = 47.333333333333 (the remainder is 1, so 3 is not a divisor of 142)
- ...
- 142 / 141 = 1.0070921985816 (the remainder is 1, so 141 is not a divisor of 142)
- 142 / 142 = 1 (the remainder is 0, so 142 is a divisor of 142)
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 142 (i.e. 11.916375287813). 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 )
- 142 / 1 = 142 (the remainder is 0, so 1 and 142 are divisors of 142)
- 142 / 2 = 71 (the remainder is 0, so 2 and 71 are divisors of 142)
- 142 / 3 = 47.333333333333 (the remainder is 1, so 3 is not a divisor of 142)
- ...
- 142 / 10 = 14.2 (the remainder is 2, so 10 is not a divisor of 142)
- 142 / 11 = 12.909090909091 (the remainder is 10, so 11 is not a divisor of 142)