What are the divisors of 9006?

1, 2, 3, 6, 19, 38, 57, 79, 114, 158, 237, 474, 1501, 3002, 4503, 9006

8 even divisors

2, 6, 38, 114, 158, 474, 3002, 9006

8 odd divisors

1, 3, 19, 57, 79, 237, 1501, 4503

How to compute the divisors of 9006?

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

  • 9006 / 1 = 9006 (the remainder is 0, so 1 is a divisor of 9006)
  • 9006 / 2 = 4503 (the remainder is 0, so 2 is a divisor of 9006)
  • 9006 / 3 = 3002 (the remainder is 0, so 3 is a divisor of 9006)
  • ...
  • 9006 / 9005 = 1.000111049417 (the remainder is 1, so 9005 is not a divisor of 9006)
  • 9006 / 9006 = 1 (the remainder is 0, so 9006 is a divisor of 9006)

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 9006 (i.e. 94.899947312946). 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 )

  • 9006 / 1 = 9006 (the remainder is 0, so 1 and 9006 are divisors of 9006)
  • 9006 / 2 = 4503 (the remainder is 0, so 2 and 4503 are divisors of 9006)
  • 9006 / 3 = 3002 (the remainder is 0, so 3 and 3002 are divisors of 9006)
  • ...
  • 9006 / 93 = 96.838709677419 (the remainder is 78, so 93 is not a divisor of 9006)
  • 9006 / 94 = 95.808510638298 (the remainder is 76, so 94 is not a divisor of 9006)