What are the divisors of 822?
1, 2, 3, 6, 137, 274, 411, 822
- There is a total of 8 positive divisors.
- The sum of these divisors is 1656.
- The arithmetic mean is 207.
4 even divisors
2, 6, 274, 822
4 odd divisors
1, 3, 137, 411
How to compute the divisors of 822?
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 822 by each of the numbers from 1 to 822 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 822 / 1 = 822 (the remainder is 0, so 1 is a divisor of 822)
- 822 / 2 = 411 (the remainder is 0, so 2 is a divisor of 822)
- 822 / 3 = 274 (the remainder is 0, so 3 is a divisor of 822)
- ...
- 822 / 821 = 1.0012180267966 (the remainder is 1, so 821 is not a divisor of 822)
- 822 / 822 = 1 (the remainder is 0, so 822 is a divisor of 822)
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 822 (i.e. 28.670542373663). 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 )
- 822 / 1 = 822 (the remainder is 0, so 1 and 822 are divisors of 822)
- 822 / 2 = 411 (the remainder is 0, so 2 and 411 are divisors of 822)
- 822 / 3 = 274 (the remainder is 0, so 3 and 274 are divisors of 822)
- ...
- 822 / 27 = 30.444444444444 (the remainder is 12, so 27 is not a divisor of 822)
- 822 / 28 = 29.357142857143 (the remainder is 10, so 28 is not a divisor of 822)