What are the divisors of 1800?

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 25, 30, 36, 40, 45, 50, 60, 72, 75, 90, 100, 120, 150, 180, 200, 225, 300, 360, 450, 600, 900, 1800

27 even divisors

2, 4, 6, 8, 10, 12, 18, 20, 24, 30, 36, 40, 50, 60, 72, 90, 100, 120, 150, 180, 200, 300, 360, 450, 600, 900, 1800

9 odd divisors

1, 3, 5, 9, 15, 25, 45, 75, 225

How to compute the divisors of 1800?

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 1800 by each of the numbers from 1 to 1800 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)

  • 1800 / 1 = 1800 (the remainder is 0, so 1 is a divisor of 1800)
  • 1800 / 2 = 900 (the remainder is 0, so 2 is a divisor of 1800)
  • 1800 / 3 = 600 (the remainder is 0, so 3 is a divisor of 1800)
  • ...
  • 1800 / 1799 = 1.0005558643691 (the remainder is 1, so 1799 is not a divisor of 1800)
  • 1800 / 1800 = 1 (the remainder is 0, so 1800 is a divisor of 1800)

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 1800 (i.e. 42.426406871193). 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 )

  • 1800 / 1 = 1800 (the remainder is 0, so 1 and 1800 are divisors of 1800)
  • 1800 / 2 = 900 (the remainder is 0, so 2 and 900 are divisors of 1800)
  • 1800 / 3 = 600 (the remainder is 0, so 3 and 600 are divisors of 1800)
  • ...
  • 1800 / 41 = 43.90243902439 (the remainder is 37, so 41 is not a divisor of 1800)
  • 1800 / 42 = 42.857142857143 (the remainder is 36, so 42 is not a divisor of 1800)