What are the divisors of 3988?
1, 2, 4, 997, 1994, 3988
- There is a total of 6 positive divisors.
- The sum of these divisors is 6986.
- The arithmetic mean is 1164.3333333333.
4 even divisors
2, 4, 1994, 3988
2 odd divisors
1, 997
How to compute the divisors of 3988?
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 3988 by each of the numbers from 1 to 3988 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 3988 / 1 = 3988 (the remainder is 0, so 1 is a divisor of 3988)
- 3988 / 2 = 1994 (the remainder is 0, so 2 is a divisor of 3988)
- 3988 / 3 = 1329.3333333333 (the remainder is 1, so 3 is not a divisor of 3988)
- ...
- 3988 / 3987 = 1.0002508151492 (the remainder is 1, so 3987 is not a divisor of 3988)
- 3988 / 3988 = 1 (the remainder is 0, so 3988 is a divisor of 3988)
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 3988 (i.e. 63.150613615388). 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 )
- 3988 / 1 = 3988 (the remainder is 0, so 1 and 3988 are divisors of 3988)
- 3988 / 2 = 1994 (the remainder is 0, so 2 and 1994 are divisors of 3988)
- 3988 / 3 = 1329.3333333333 (the remainder is 1, so 3 is not a divisor of 3988)
- ...
- 3988 / 62 = 64.322580645161 (the remainder is 20, so 62 is not a divisor of 3988)
- 3988 / 63 = 63.301587301587 (the remainder is 19, so 63 is not a divisor of 3988)