What are the divisors of 997?
1, 997
- There is a total of 2 positive divisors.
- The sum of these divisors is 998.
- The arithmetic mean is 499.
2 odd divisors
1, 997
How to compute the divisors of 997?
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 997 by each of the numbers from 1 to 997 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 997 / 1 = 997 (the remainder is 0, so 1 is a divisor of 997)
- 997 / 2 = 498.5 (the remainder is 1, so 2 is not a divisor of 997)
- 997 / 3 = 332.33333333333 (the remainder is 1, so 3 is not a divisor of 997)
- ...
- 997 / 996 = 1.0010040160643 (the remainder is 1, so 996 is not a divisor of 997)
- 997 / 997 = 1 (the remainder is 0, so 997 is a divisor of 997)
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 997 (i.e. 31.575306807694). 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 )
- 997 / 1 = 997 (the remainder is 0, so 1 and 997 are divisors of 997)
- 997 / 2 = 498.5 (the remainder is 1, so 2 is not a divisor of 997)
- 997 / 3 = 332.33333333333 (the remainder is 1, so 3 is not a divisor of 997)
- ...
- 997 / 30 = 33.233333333333 (the remainder is 7, so 30 is not a divisor of 997)
- 997 / 31 = 32.161290322581 (the remainder is 5, so 31 is not a divisor of 997)