What are the divisors of 279?
1, 3, 9, 31, 93, 279
- There is a total of 6 positive divisors.
- The sum of these divisors is 416.
- The arithmetic mean is 69.333333333333.
6 odd divisors
1, 3, 9, 31, 93, 279
How to compute the divisors of 279?
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 279 by each of the numbers from 1 to 279 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 279 / 1 = 279 (the remainder is 0, so 1 is a divisor of 279)
- 279 / 2 = 139.5 (the remainder is 1, so 2 is not a divisor of 279)
- 279 / 3 = 93 (the remainder is 0, so 3 is a divisor of 279)
- ...
- 279 / 278 = 1.0035971223022 (the remainder is 1, so 278 is not a divisor of 279)
- 279 / 279 = 1 (the remainder is 0, so 279 is a divisor of 279)
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 279 (i.e. 16.70329308849). 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 )
- 279 / 1 = 279 (the remainder is 0, so 1 and 279 are divisors of 279)
- 279 / 2 = 139.5 (the remainder is 1, so 2 is not a divisor of 279)
- 279 / 3 = 93 (the remainder is 0, so 3 and 93 are divisors of 279)
- ...
- 279 / 15 = 18.6 (the remainder is 9, so 15 is not a divisor of 279)
- 279 / 16 = 17.4375 (the remainder is 7, so 16 is not a divisor of 279)