What are the divisors of 792?
1, 2, 3, 4, 6, 8, 9, 11, 12, 18, 22, 24, 33, 36, 44, 66, 72, 88, 99, 132, 198, 264, 396, 792
- There is a total of 24 positive divisors.
- The sum of these divisors is 2340.
- The arithmetic mean is 97.5.
18 even divisors
2, 4, 6, 8, 12, 18, 22, 24, 36, 44, 66, 72, 88, 132, 198, 264, 396, 792
6 odd divisors
1, 3, 9, 11, 33, 99
How to compute the divisors of 792?
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 792 by each of the numbers from 1 to 792 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 792 / 1 = 792 (the remainder is 0, so 1 is a divisor of 792)
- 792 / 2 = 396 (the remainder is 0, so 2 is a divisor of 792)
- 792 / 3 = 264 (the remainder is 0, so 3 is a divisor of 792)
- ...
- 792 / 791 = 1.0012642225032 (the remainder is 1, so 791 is not a divisor of 792)
- 792 / 792 = 1 (the remainder is 0, so 792 is a divisor of 792)
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 792 (i.e. 28.142494558941). 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 )
- 792 / 1 = 792 (the remainder is 0, so 1 and 792 are divisors of 792)
- 792 / 2 = 396 (the remainder is 0, so 2 and 396 are divisors of 792)
- 792 / 3 = 264 (the remainder is 0, so 3 and 264 are divisors of 792)
- ...
- 792 / 27 = 29.333333333333 (the remainder is 9, so 27 is not a divisor of 792)
- 792 / 28 = 28.285714285714 (the remainder is 8, so 28 is not a divisor of 792)