What are the divisors of 4006?
1, 2, 2003, 4006
- There is a total of 4 positive divisors.
- The sum of these divisors is 6012.
- The arithmetic mean is 1503.
2 even divisors
2, 4006
2 odd divisors
1, 2003
How to compute the divisors of 4006?
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 4006 by each of the numbers from 1 to 4006 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 4006 / 1 = 4006 (the remainder is 0, so 1 is a divisor of 4006)
- 4006 / 2 = 2003 (the remainder is 0, so 2 is a divisor of 4006)
- 4006 / 3 = 1335.3333333333 (the remainder is 1, so 3 is not a divisor of 4006)
- ...
- 4006 / 4005 = 1.0002496878901 (the remainder is 1, so 4005 is not a divisor of 4006)
- 4006 / 4006 = 1 (the remainder is 0, so 4006 is a divisor of 4006)
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 4006 (i.e. 63.292969593787). 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 )
- 4006 / 1 = 4006 (the remainder is 0, so 1 and 4006 are divisors of 4006)
- 4006 / 2 = 2003 (the remainder is 0, so 2 and 2003 are divisors of 4006)
- 4006 / 3 = 1335.3333333333 (the remainder is 1, so 3 is not a divisor of 4006)
- ...
- 4006 / 62 = 64.612903225806 (the remainder is 38, so 62 is not a divisor of 4006)
- 4006 / 63 = 63.587301587302 (the remainder is 37, so 63 is not a divisor of 4006)