What are the divisors of 4079?
1, 4079
- There is a total of 2 positive divisors.
- The sum of these divisors is 4080.
- The arithmetic mean is 2040.
2 odd divisors
1, 4079
How to compute the divisors of 4079?
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 4079 by each of the numbers from 1 to 4079 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 4079 / 1 = 4079 (the remainder is 0, so 1 is a divisor of 4079)
- 4079 / 2 = 2039.5 (the remainder is 1, so 2 is not a divisor of 4079)
- 4079 / 3 = 1359.6666666667 (the remainder is 2, so 3 is not a divisor of 4079)
- ...
- 4079 / 4078 = 1.0002452182442 (the remainder is 1, so 4078 is not a divisor of 4079)
- 4079 / 4079 = 1 (the remainder is 0, so 4079 is a divisor of 4079)
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 4079 (i.e. 63.867049407343). 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 )
- 4079 / 1 = 4079 (the remainder is 0, so 1 and 4079 are divisors of 4079)
- 4079 / 2 = 2039.5 (the remainder is 1, so 2 is not a divisor of 4079)
- 4079 / 3 = 1359.6666666667 (the remainder is 2, so 3 is not a divisor of 4079)
- ...
- 4079 / 62 = 65.790322580645 (the remainder is 49, so 62 is not a divisor of 4079)
- 4079 / 63 = 64.746031746032 (the remainder is 47, so 63 is not a divisor of 4079)