What are the divisors of 1188?

1, 2, 3, 4, 6, 9, 11, 12, 18, 22, 27, 33, 36, 44, 54, 66, 99, 108, 132, 198, 297, 396, 594, 1188

16 even divisors

2, 4, 6, 12, 18, 22, 36, 44, 54, 66, 108, 132, 198, 396, 594, 1188

8 odd divisors

1, 3, 9, 11, 27, 33, 99, 297

How to compute the divisors of 1188?

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

  • 1188 / 1 = 1188 (the remainder is 0, so 1 is a divisor of 1188)
  • 1188 / 2 = 594 (the remainder is 0, so 2 is a divisor of 1188)
  • 1188 / 3 = 396 (the remainder is 0, so 3 is a divisor of 1188)
  • ...
  • 1188 / 1187 = 1.0008424599832 (the remainder is 1, so 1187 is not a divisor of 1188)
  • 1188 / 1188 = 1 (the remainder is 0, so 1188 is a divisor of 1188)

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 1188 (i.e. 34.467375879228). 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 )

  • 1188 / 1 = 1188 (the remainder is 0, so 1 and 1188 are divisors of 1188)
  • 1188 / 2 = 594 (the remainder is 0, so 2 and 594 are divisors of 1188)
  • 1188 / 3 = 396 (the remainder is 0, so 3 and 396 are divisors of 1188)
  • ...
  • 1188 / 33 = 36 (the remainder is 0, so 33 and 36 are divisors of 1188)
  • 1188 / 34 = 34.941176470588 (the remainder is 32, so 34 is not a divisor of 1188)