What are the divisors of 391?
1, 17, 23, 391
- There is a total of 4 positive divisors.
- The sum of these divisors is 432.
- The arithmetic mean is 108.
4 odd divisors
1, 17, 23, 391
How to compute the divisors of 391?
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 391 by each of the numbers from 1 to 391 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 391 / 1 = 391 (the remainder is 0, so 1 is a divisor of 391)
- 391 / 2 = 195.5 (the remainder is 1, so 2 is not a divisor of 391)
- 391 / 3 = 130.33333333333 (the remainder is 1, so 3 is not a divisor of 391)
- ...
- 391 / 390 = 1.0025641025641 (the remainder is 1, so 390 is not a divisor of 391)
- 391 / 391 = 1 (the remainder is 0, so 391 is a divisor of 391)
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 391 (i.e. 19.773719933285). 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 )
- 391 / 1 = 391 (the remainder is 0, so 1 and 391 are divisors of 391)
- 391 / 2 = 195.5 (the remainder is 1, so 2 is not a divisor of 391)
- 391 / 3 = 130.33333333333 (the remainder is 1, so 3 is not a divisor of 391)
- ...
- 391 / 18 = 21.722222222222 (the remainder is 13, so 18 is not a divisor of 391)
- 391 / 19 = 20.578947368421 (the remainder is 11, so 19 is not a divisor of 391)