What are the divisors of 4012?
1, 2, 4, 17, 34, 59, 68, 118, 236, 1003, 2006, 4012
- There is a total of 12 positive divisors.
- The sum of these divisors is 7560.
- The arithmetic mean is 630.
8 even divisors
2, 4, 34, 68, 118, 236, 2006, 4012
4 odd divisors
1, 17, 59, 1003
How to compute the divisors of 4012?
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 4012 by each of the numbers from 1 to 4012 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 4012 / 1 = 4012 (the remainder is 0, so 1 is a divisor of 4012)
- 4012 / 2 = 2006 (the remainder is 0, so 2 is a divisor of 4012)
- 4012 / 3 = 1337.3333333333 (the remainder is 1, so 3 is not a divisor of 4012)
- ...
- 4012 / 4011 = 1.0002493143854 (the remainder is 1, so 4011 is not a divisor of 4012)
- 4012 / 4012 = 1 (the remainder is 0, so 4012 is a divisor of 4012)
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 4012 (i.e. 63.340350488452). 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 )
- 4012 / 1 = 4012 (the remainder is 0, so 1 and 4012 are divisors of 4012)
- 4012 / 2 = 2006 (the remainder is 0, so 2 and 2006 are divisors of 4012)
- 4012 / 3 = 1337.3333333333 (the remainder is 1, so 3 is not a divisor of 4012)
- ...
- 4012 / 62 = 64.709677419355 (the remainder is 44, so 62 is not a divisor of 4012)
- 4012 / 63 = 63.68253968254 (the remainder is 43, so 63 is not a divisor of 4012)