What are the divisors of 333?
1, 3, 9, 37, 111, 333
- There is a total of 6 positive divisors.
- The sum of these divisors is 494.
- The arithmetic mean is 82.333333333333.
6 odd divisors
1, 3, 9, 37, 111, 333
How to compute the divisors of 333?
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 333 by each of the numbers from 1 to 333 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 333 / 1 = 333 (the remainder is 0, so 1 is a divisor of 333)
- 333 / 2 = 166.5 (the remainder is 1, so 2 is not a divisor of 333)
- 333 / 3 = 111 (the remainder is 0, so 3 is a divisor of 333)
- ...
- 333 / 332 = 1.0030120481928 (the remainder is 1, so 332 is not a divisor of 333)
- 333 / 333 = 1 (the remainder is 0, so 333 is a divisor of 333)
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 333 (i.e. 18.248287590895). 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 )
- 333 / 1 = 333 (the remainder is 0, so 1 and 333 are divisors of 333)
- 333 / 2 = 166.5 (the remainder is 1, so 2 is not a divisor of 333)
- 333 / 3 = 111 (the remainder is 0, so 3 and 111 are divisors of 333)
- ...
- 333 / 17 = 19.588235294118 (the remainder is 10, so 17 is not a divisor of 333)
- 333 / 18 = 18.5 (the remainder is 9, so 18 is not a divisor of 333)