What are the divisors of 4157?
1, 4157
- There is a total of 2 positive divisors.
- The sum of these divisors is 4158.
- The arithmetic mean is 2079.
2 odd divisors
1, 4157
How to compute the divisors of 4157?
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 4157 by each of the numbers from 1 to 4157 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 4157 / 1 = 4157 (the remainder is 0, so 1 is a divisor of 4157)
- 4157 / 2 = 2078.5 (the remainder is 1, so 2 is not a divisor of 4157)
- 4157 / 3 = 1385.6666666667 (the remainder is 2, so 3 is not a divisor of 4157)
- ...
- 4157 / 4156 = 1.0002406159769 (the remainder is 1, so 4156 is not a divisor of 4157)
- 4157 / 4157 = 1 (the remainder is 0, so 4157 is a divisor of 4157)
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 4157 (i.e. 64.474801279259). 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 )
- 4157 / 1 = 4157 (the remainder is 0, so 1 and 4157 are divisors of 4157)
- 4157 / 2 = 2078.5 (the remainder is 1, so 2 is not a divisor of 4157)
- 4157 / 3 = 1385.6666666667 (the remainder is 2, so 3 is not a divisor of 4157)
- ...
- 4157 / 63 = 65.984126984127 (the remainder is 62, so 63 is not a divisor of 4157)
- 4157 / 64 = 64.953125 (the remainder is 61, so 64 is not a divisor of 4157)