What are the divisors of 4020?
1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60, 67, 134, 201, 268, 335, 402, 670, 804, 1005, 1340, 2010, 4020
- There is a total of 24 positive divisors.
- The sum of these divisors is 11424.
- The arithmetic mean is 476.
16 even divisors
2, 4, 6, 10, 12, 20, 30, 60, 134, 268, 402, 670, 804, 1340, 2010, 4020
8 odd divisors
1, 3, 5, 15, 67, 201, 335, 1005
How to compute the divisors of 4020?
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 4020 by each of the numbers from 1 to 4020 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 4020 / 1 = 4020 (the remainder is 0, so 1 is a divisor of 4020)
- 4020 / 2 = 2010 (the remainder is 0, so 2 is a divisor of 4020)
- 4020 / 3 = 1340 (the remainder is 0, so 3 is a divisor of 4020)
- ...
- 4020 / 4019 = 1.000248818114 (the remainder is 1, so 4019 is not a divisor of 4020)
- 4020 / 4020 = 1 (the remainder is 0, so 4020 is a divisor of 4020)
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 4020 (i.e. 63.403469936589). 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 )
- 4020 / 1 = 4020 (the remainder is 0, so 1 and 4020 are divisors of 4020)
- 4020 / 2 = 2010 (the remainder is 0, so 2 and 2010 are divisors of 4020)
- 4020 / 3 = 1340 (the remainder is 0, so 3 and 1340 are divisors of 4020)
- ...
- 4020 / 62 = 64.838709677419 (the remainder is 52, so 62 is not a divisor of 4020)
- 4020 / 63 = 63.809523809524 (the remainder is 51, so 63 is not a divisor of 4020)