What are the divisors of 1224?

1, 2, 3, 4, 6, 8, 9, 12, 17, 18, 24, 34, 36, 51, 68, 72, 102, 136, 153, 204, 306, 408, 612, 1224

18 even divisors

2, 4, 6, 8, 12, 18, 24, 34, 36, 68, 72, 102, 136, 204, 306, 408, 612, 1224

6 odd divisors

1, 3, 9, 17, 51, 153

How to compute the divisors of 1224?

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

  • 1224 / 1 = 1224 (the remainder is 0, so 1 is a divisor of 1224)
  • 1224 / 2 = 612 (the remainder is 0, so 2 is a divisor of 1224)
  • 1224 / 3 = 408 (the remainder is 0, so 3 is a divisor of 1224)
  • ...
  • 1224 / 1223 = 1.0008176614881 (the remainder is 1, so 1223 is not a divisor of 1224)
  • 1224 / 1224 = 1 (the remainder is 0, so 1224 is a divisor of 1224)

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 1224 (i.e. 34.985711369072). 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 )

  • 1224 / 1 = 1224 (the remainder is 0, so 1 and 1224 are divisors of 1224)
  • 1224 / 2 = 612 (the remainder is 0, so 2 and 612 are divisors of 1224)
  • 1224 / 3 = 408 (the remainder is 0, so 3 and 408 are divisors of 1224)
  • ...
  • 1224 / 33 = 37.090909090909 (the remainder is 3, so 33 is not a divisor of 1224)
  • 1224 / 34 = 36 (the remainder is 0, so 34 and 36 are divisors of 1224)