What are the divisors of 819?
1, 3, 7, 9, 13, 21, 39, 63, 91, 117, 273, 819
- There is a total of 12 positive divisors.
- The sum of these divisors is 1456.
- The arithmetic mean is 121.33333333333.
12 odd divisors
1, 3, 7, 9, 13, 21, 39, 63, 91, 117, 273, 819
How to compute the divisors of 819?
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 819 by each of the numbers from 1 to 819 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 819 / 1 = 819 (the remainder is 0, so 1 is a divisor of 819)
- 819 / 2 = 409.5 (the remainder is 1, so 2 is not a divisor of 819)
- 819 / 3 = 273 (the remainder is 0, so 3 is a divisor of 819)
- ...
- 819 / 818 = 1.0012224938875 (the remainder is 1, so 818 is not a divisor of 819)
- 819 / 819 = 1 (the remainder is 0, so 819 is a divisor of 819)
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 819 (i.e. 28.618176042508). 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 )
- 819 / 1 = 819 (the remainder is 0, so 1 and 819 are divisors of 819)
- 819 / 2 = 409.5 (the remainder is 1, so 2 is not a divisor of 819)
- 819 / 3 = 273 (the remainder is 0, so 3 and 273 are divisors of 819)
- ...
- 819 / 27 = 30.333333333333 (the remainder is 9, so 27 is not a divisor of 819)
- 819 / 28 = 29.25 (the remainder is 7, so 28 is not a divisor of 819)