What are the divisors of 3204?

1, 2, 3, 4, 6, 9, 12, 18, 36, 89, 178, 267, 356, 534, 801, 1068, 1602, 3204

12 even divisors

2, 4, 6, 12, 18, 36, 178, 356, 534, 1068, 1602, 3204

6 odd divisors

1, 3, 9, 89, 267, 801

How to compute the divisors of 3204?

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

  • 3204 / 1 = 3204 (the remainder is 0, so 1 is a divisor of 3204)
  • 3204 / 2 = 1602 (the remainder is 0, so 2 is a divisor of 3204)
  • 3204 / 3 = 1068 (the remainder is 0, so 3 is a divisor of 3204)
  • ...
  • 3204 / 3203 = 1.0003122073057 (the remainder is 1, so 3203 is not a divisor of 3204)
  • 3204 / 3204 = 1 (the remainder is 0, so 3204 is a divisor of 3204)

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 3204 (i.e. 56.60388679234). 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 )

  • 3204 / 1 = 3204 (the remainder is 0, so 1 and 3204 are divisors of 3204)
  • 3204 / 2 = 1602 (the remainder is 0, so 2 and 1602 are divisors of 3204)
  • 3204 / 3 = 1068 (the remainder is 0, so 3 and 1068 are divisors of 3204)
  • ...
  • 3204 / 55 = 58.254545454545 (the remainder is 14, so 55 is not a divisor of 3204)
  • 3204 / 56 = 57.214285714286 (the remainder is 12, so 56 is not a divisor of 3204)