What are the divisors of 1836?

1, 2, 3, 4, 6, 9, 12, 17, 18, 27, 34, 36, 51, 54, 68, 102, 108, 153, 204, 306, 459, 612, 918, 1836

16 even divisors

2, 4, 6, 12, 18, 34, 36, 54, 68, 102, 108, 204, 306, 612, 918, 1836

8 odd divisors

1, 3, 9, 17, 27, 51, 153, 459

How to compute the divisors of 1836?

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

  • 1836 / 1 = 1836 (the remainder is 0, so 1 is a divisor of 1836)
  • 1836 / 2 = 918 (the remainder is 0, so 2 is a divisor of 1836)
  • 1836 / 3 = 612 (the remainder is 0, so 3 is a divisor of 1836)
  • ...
  • 1836 / 1835 = 1.0005449591281 (the remainder is 1, so 1835 is not a divisor of 1836)
  • 1836 / 1836 = 1 (the remainder is 0, so 1836 is a divisor of 1836)

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 1836 (i.e. 42.848570571257). 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 )

  • 1836 / 1 = 1836 (the remainder is 0, so 1 and 1836 are divisors of 1836)
  • 1836 / 2 = 918 (the remainder is 0, so 2 and 918 are divisors of 1836)
  • 1836 / 3 = 612 (the remainder is 0, so 3 and 612 are divisors of 1836)
  • ...
  • 1836 / 41 = 44.780487804878 (the remainder is 32, so 41 is not a divisor of 1836)
  • 1836 / 42 = 43.714285714286 (the remainder is 30, so 42 is not a divisor of 1836)