What are the divisors of 309?
1, 3, 103, 309
- There is a total of 4 positive divisors.
- The sum of these divisors is 416.
- The arithmetic mean is 104.
4 odd divisors
1, 3, 103, 309
How to compute the divisors of 309?
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 309 by each of the numbers from 1 to 309 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 309 / 1 = 309 (the remainder is 0, so 1 is a divisor of 309)
- 309 / 2 = 154.5 (the remainder is 1, so 2 is not a divisor of 309)
- 309 / 3 = 103 (the remainder is 0, so 3 is a divisor of 309)
- ...
- 309 / 308 = 1.0032467532468 (the remainder is 1, so 308 is not a divisor of 309)
- 309 / 309 = 1 (the remainder is 0, so 309 is a divisor of 309)
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 309 (i.e. 17.578395831247). 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 )
- 309 / 1 = 309 (the remainder is 0, so 1 and 309 are divisors of 309)
- 309 / 2 = 154.5 (the remainder is 1, so 2 is not a divisor of 309)
- 309 / 3 = 103 (the remainder is 0, so 3 and 103 are divisors of 309)
- ...
- 309 / 16 = 19.3125 (the remainder is 5, so 16 is not a divisor of 309)
- 309 / 17 = 18.176470588235 (the remainder is 3, so 17 is not a divisor of 309)