What are the divisors of 1044?

1, 2, 3, 4, 6, 9, 12, 18, 29, 36, 58, 87, 116, 174, 261, 348, 522, 1044

12 even divisors

2, 4, 6, 12, 18, 36, 58, 116, 174, 348, 522, 1044

6 odd divisors

1, 3, 9, 29, 87, 261

How to compute the divisors of 1044?

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

  • 1044 / 1 = 1044 (the remainder is 0, so 1 is a divisor of 1044)
  • 1044 / 2 = 522 (the remainder is 0, so 2 is a divisor of 1044)
  • 1044 / 3 = 348 (the remainder is 0, so 3 is a divisor of 1044)
  • ...
  • 1044 / 1043 = 1.0009587727709 (the remainder is 1, so 1043 is not a divisor of 1044)
  • 1044 / 1044 = 1 (the remainder is 0, so 1044 is a divisor of 1044)

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 1044 (i.e. 32.310988842807). 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 )

  • 1044 / 1 = 1044 (the remainder is 0, so 1 and 1044 are divisors of 1044)
  • 1044 / 2 = 522 (the remainder is 0, so 2 and 522 are divisors of 1044)
  • 1044 / 3 = 348 (the remainder is 0, so 3 and 348 are divisors of 1044)
  • ...
  • 1044 / 31 = 33.677419354839 (the remainder is 21, so 31 is not a divisor of 1044)
  • 1044 / 32 = 32.625 (the remainder is 20, so 32 is not a divisor of 1044)