What are the divisors of 4104?
1, 2, 3, 4, 6, 8, 9, 12, 18, 19, 24, 27, 36, 38, 54, 57, 72, 76, 108, 114, 152, 171, 216, 228, 342, 456, 513, 684, 1026, 1368, 2052, 4104
- There is a total of 32 positive divisors.
- The sum of these divisors is 12000.
- The arithmetic mean is 375.
24 even divisors
2, 4, 6, 8, 12, 18, 24, 36, 38, 54, 72, 76, 108, 114, 152, 216, 228, 342, 456, 684, 1026, 1368, 2052, 4104
8 odd divisors
1, 3, 9, 19, 27, 57, 171, 513
How to compute the divisors of 4104?
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 4104 by each of the numbers from 1 to 4104 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 4104 / 1 = 4104 (the remainder is 0, so 1 is a divisor of 4104)
- 4104 / 2 = 2052 (the remainder is 0, so 2 is a divisor of 4104)
- 4104 / 3 = 1368 (the remainder is 0, so 3 is a divisor of 4104)
- ...
- 4104 / 4103 = 1.0002437241043 (the remainder is 1, so 4103 is not a divisor of 4104)
- 4104 / 4104 = 1 (the remainder is 0, so 4104 is a divisor of 4104)
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 4104 (i.e. 64.062469512188). 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 )
- 4104 / 1 = 4104 (the remainder is 0, so 1 and 4104 are divisors of 4104)
- 4104 / 2 = 2052 (the remainder is 0, so 2 and 2052 are divisors of 4104)
- 4104 / 3 = 1368 (the remainder is 0, so 3 and 1368 are divisors of 4104)
- ...
- 4104 / 63 = 65.142857142857 (the remainder is 9, so 63 is not a divisor of 4104)
- 4104 / 64 = 64.125 (the remainder is 8, so 64 is not a divisor of 4104)