What are the divisors of 393?
1, 3, 131, 393
- There is a total of 4 positive divisors.
- The sum of these divisors is 528.
- The arithmetic mean is 132.
4 odd divisors
1, 3, 131, 393
How to compute the divisors of 393?
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 393 by each of the numbers from 1 to 393 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 393 / 1 = 393 (the remainder is 0, so 1 is a divisor of 393)
- 393 / 2 = 196.5 (the remainder is 1, so 2 is not a divisor of 393)
- 393 / 3 = 131 (the remainder is 0, so 3 is a divisor of 393)
- ...
- 393 / 392 = 1.0025510204082 (the remainder is 1, so 392 is not a divisor of 393)
- 393 / 393 = 1 (the remainder is 0, so 393 is a divisor of 393)
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 393 (i.e. 19.824227601599). 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 )
- 393 / 1 = 393 (the remainder is 0, so 1 and 393 are divisors of 393)
- 393 / 2 = 196.5 (the remainder is 1, so 2 is not a divisor of 393)
- 393 / 3 = 131 (the remainder is 0, so 3 and 131 are divisors of 393)
- ...
- 393 / 18 = 21.833333333333 (the remainder is 15, so 18 is not a divisor of 393)
- 393 / 19 = 20.684210526316 (the remainder is 13, so 19 is not a divisor of 393)