What are the divisors of 636?
1, 2, 3, 4, 6, 12, 53, 106, 159, 212, 318, 636
- There is a total of 12 positive divisors.
- The sum of these divisors is 1512.
- The arithmetic mean is 126.
8 even divisors
2, 4, 6, 12, 106, 212, 318, 636
4 odd divisors
1, 3, 53, 159
How to compute the divisors of 636?
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 636 by each of the numbers from 1 to 636 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 636 / 1 = 636 (the remainder is 0, so 1 is a divisor of 636)
- 636 / 2 = 318 (the remainder is 0, so 2 is a divisor of 636)
- 636 / 3 = 212 (the remainder is 0, so 3 is a divisor of 636)
- ...
- 636 / 635 = 1.0015748031496 (the remainder is 1, so 635 is not a divisor of 636)
- 636 / 636 = 1 (the remainder is 0, so 636 is a divisor of 636)
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 636 (i.e. 25.219040425837). 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 )
- 636 / 1 = 636 (the remainder is 0, so 1 and 636 are divisors of 636)
- 636 / 2 = 318 (the remainder is 0, so 2 and 318 are divisors of 636)
- 636 / 3 = 212 (the remainder is 0, so 3 and 212 are divisors of 636)
- ...
- 636 / 24 = 26.5 (the remainder is 12, so 24 is not a divisor of 636)
- 636 / 25 = 25.44 (the remainder is 11, so 25 is not a divisor of 636)