What are the divisors of 360?
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
- There is a total of 24 positive divisors.
- The sum of these divisors is 1170.
- The arithmetic mean is 48.75.
18 even divisors
2, 4, 6, 8, 10, 12, 18, 20, 24, 30, 36, 40, 60, 72, 90, 120, 180, 360
6 odd divisors
1, 3, 5, 9, 15, 45
How to compute the divisors of 360?
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 360 by each of the numbers from 1 to 360 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 360 / 1 = 360 (the remainder is 0, so 1 is a divisor of 360)
- 360 / 2 = 180 (the remainder is 0, so 2 is a divisor of 360)
- 360 / 3 = 120 (the remainder is 0, so 3 is a divisor of 360)
- ...
- 360 / 359 = 1.0027855153203 (the remainder is 1, so 359 is not a divisor of 360)
- 360 / 360 = 1 (the remainder is 0, so 360 is a divisor of 360)
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 360 (i.e. 18.97366596101). 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 )
- 360 / 1 = 360 (the remainder is 0, so 1 and 360 are divisors of 360)
- 360 / 2 = 180 (the remainder is 0, so 2 and 180 are divisors of 360)
- 360 / 3 = 120 (the remainder is 0, so 3 and 120 are divisors of 360)
- ...
- 360 / 17 = 21.176470588235 (the remainder is 3, so 17 is not a divisor of 360)
- 360 / 18 = 20 (the remainder is 0, so 18 and 20 are divisors of 360)