What are the divisors of 3995?
1, 5, 17, 47, 85, 235, 799, 3995
- There is a total of 8 positive divisors.
- The sum of these divisors is 5184.
- The arithmetic mean is 648.
8 odd divisors
1, 5, 17, 47, 85, 235, 799, 3995
How to compute the divisors of 3995?
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 3995 by each of the numbers from 1 to 3995 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 3995 / 1 = 3995 (the remainder is 0, so 1 is a divisor of 3995)
- 3995 / 2 = 1997.5 (the remainder is 1, so 2 is not a divisor of 3995)
- 3995 / 3 = 1331.6666666667 (the remainder is 2, so 3 is not a divisor of 3995)
- ...
- 3995 / 3994 = 1.0002503755633 (the remainder is 1, so 3994 is not a divisor of 3995)
- 3995 / 3995 = 1 (the remainder is 0, so 3995 is a divisor of 3995)
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 3995 (i.e. 63.206012372242). 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 )
- 3995 / 1 = 3995 (the remainder is 0, so 1 and 3995 are divisors of 3995)
- 3995 / 2 = 1997.5 (the remainder is 1, so 2 is not a divisor of 3995)
- 3995 / 3 = 1331.6666666667 (the remainder is 2, so 3 is not a divisor of 3995)
- ...
- 3995 / 62 = 64.435483870968 (the remainder is 27, so 62 is not a divisor of 3995)
- 3995 / 63 = 63.412698412698 (the remainder is 26, so 63 is not a divisor of 3995)