What are the divisors of 9002?

1, 2, 7, 14, 643, 1286, 4501, 9002

4 even divisors

2, 14, 1286, 9002

4 odd divisors

1, 7, 643, 4501

How to compute the divisors of 9002?

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

  • 9002 / 1 = 9002 (the remainder is 0, so 1 is a divisor of 9002)
  • 9002 / 2 = 4501 (the remainder is 0, so 2 is a divisor of 9002)
  • 9002 / 3 = 3000.6666666667 (the remainder is 2, so 3 is not a divisor of 9002)
  • ...
  • 9002 / 9001 = 1.0001110987668 (the remainder is 1, so 9001 is not a divisor of 9002)
  • 9002 / 9002 = 1 (the remainder is 0, so 9002 is a divisor of 9002)

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 9002 (i.e. 94.878870145043). 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 )

  • 9002 / 1 = 9002 (the remainder is 0, so 1 and 9002 are divisors of 9002)
  • 9002 / 2 = 4501 (the remainder is 0, so 2 and 4501 are divisors of 9002)
  • 9002 / 3 = 3000.6666666667 (the remainder is 2, so 3 is not a divisor of 9002)
  • ...
  • 9002 / 93 = 96.795698924731 (the remainder is 74, so 93 is not a divisor of 9002)
  • 9002 / 94 = 95.765957446809 (the remainder is 72, so 94 is not a divisor of 9002)