What are the divisors of 1584?

1, 2, 3, 4, 6, 8, 9, 11, 12, 16, 18, 22, 24, 33, 36, 44, 48, 66, 72, 88, 99, 132, 144, 176, 198, 264, 396, 528, 792, 1584

24 even divisors

2, 4, 6, 8, 12, 16, 18, 22, 24, 36, 44, 48, 66, 72, 88, 132, 144, 176, 198, 264, 396, 528, 792, 1584

6 odd divisors

1, 3, 9, 11, 33, 99

How to compute the divisors of 1584?

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

  • 1584 / 1 = 1584 (the remainder is 0, so 1 is a divisor of 1584)
  • 1584 / 2 = 792 (the remainder is 0, so 2 is a divisor of 1584)
  • 1584 / 3 = 528 (the remainder is 0, so 3 is a divisor of 1584)
  • ...
  • 1584 / 1583 = 1.0006317119394 (the remainder is 1, so 1583 is not a divisor of 1584)
  • 1584 / 1584 = 1 (the remainder is 0, so 1584 is a divisor of 1584)

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 1584 (i.e. 39.799497484265). 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 )

  • 1584 / 1 = 1584 (the remainder is 0, so 1 and 1584 are divisors of 1584)
  • 1584 / 2 = 792 (the remainder is 0, so 2 and 792 are divisors of 1584)
  • 1584 / 3 = 528 (the remainder is 0, so 3 and 528 are divisors of 1584)
  • ...
  • 1584 / 38 = 41.684210526316 (the remainder is 26, so 38 is not a divisor of 1584)
  • 1584 / 39 = 40.615384615385 (the remainder is 24, so 39 is not a divisor of 1584)