What are the divisors of 291?
1, 3, 97, 291
- There is a total of 4 positive divisors.
- The sum of these divisors is 392.
- The arithmetic mean is 98.
4 odd divisors
1, 3, 97, 291
How to compute the divisors of 291?
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 291 by each of the numbers from 1 to 291 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 291 / 1 = 291 (the remainder is 0, so 1 is a divisor of 291)
- 291 / 2 = 145.5 (the remainder is 1, so 2 is not a divisor of 291)
- 291 / 3 = 97 (the remainder is 0, so 3 is a divisor of 291)
- ...
- 291 / 290 = 1.0034482758621 (the remainder is 1, so 290 is not a divisor of 291)
- 291 / 291 = 1 (the remainder is 0, so 291 is a divisor of 291)
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 291 (i.e. 17.058722109232). 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 )
- 291 / 1 = 291 (the remainder is 0, so 1 and 291 are divisors of 291)
- 291 / 2 = 145.5 (the remainder is 1, so 2 is not a divisor of 291)
- 291 / 3 = 97 (the remainder is 0, so 3 and 97 are divisors of 291)
- ...
- 291 / 16 = 18.1875 (the remainder is 3, so 16 is not a divisor of 291)
- 291 / 17 = 17.117647058824 (the remainder is 2, so 17 is not a divisor of 291)