What are the divisors of 1620?

1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 45, 54, 60, 81, 90, 108, 135, 162, 180, 270, 324, 405, 540, 810, 1620

20 even divisors

2, 4, 6, 10, 12, 18, 20, 30, 36, 54, 60, 90, 108, 162, 180, 270, 324, 540, 810, 1620

10 odd divisors

1, 3, 5, 9, 15, 27, 45, 81, 135, 405

How to compute the divisors of 1620?

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.

N mod M = 0

Brute force algorithm

We could start by using a brute-force method which would involve dividing 1620 by each of the numbers from 1 to 1620 to determine which ones have a remainder equal to 0.

Remainder = N ( M × N M )

(where N M is the integer part of the quotient)

  • 1620 / 1 = 1620 (the remainder is 0, so 1 is a divisor of 1620)
  • 1620 / 2 = 810 (the remainder is 0, so 2 is a divisor of 1620)
  • 1620 / 3 = 540 (the remainder is 0, so 3 is a divisor of 1620)
  • ...
  • 1620 / 1619 = 1.0006176652254 (the remainder is 1, so 1619 is not a divisor of 1620)
  • 1620 / 1620 = 1 (the remainder is 0, so 1620 is a divisor of 1620)

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 1620 (i.e. 40.249223594996). Indeed, if a number N has a divisor D greater than its square root, then there is necessarily a smaller divisor d such that:

D × d = N

(thus, if N D = d , then N d = D )

  • 1620 / 1 = 1620 (the remainder is 0, so 1 and 1620 are divisors of 1620)
  • 1620 / 2 = 810 (the remainder is 0, so 2 and 810 are divisors of 1620)
  • 1620 / 3 = 540 (the remainder is 0, so 3 and 540 are divisors of 1620)
  • ...
  • 1620 / 39 = 41.538461538462 (the remainder is 21, so 39 is not a divisor of 1620)
  • 1620 / 40 = 40.5 (the remainder is 20, so 40 is not a divisor of 1620)