What are the divisors of 3002?

1, 2, 19, 38, 79, 158, 1501, 3002

4 even divisors

2, 38, 158, 3002

4 odd divisors

1, 19, 79, 1501

How to compute the divisors of 3002?

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

  • 3002 / 1 = 3002 (the remainder is 0, so 1 is a divisor of 3002)
  • 3002 / 2 = 1501 (the remainder is 0, so 2 is a divisor of 3002)
  • 3002 / 3 = 1000.6666666667 (the remainder is 2, so 3 is not a divisor of 3002)
  • ...
  • 3002 / 3001 = 1.0003332222592 (the remainder is 1, so 3001 is not a divisor of 3002)
  • 3002 / 3002 = 1 (the remainder is 0, so 3002 is a divisor of 3002)

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 3002 (i.e. 54.790510127211). 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 )

  • 3002 / 1 = 3002 (the remainder is 0, so 1 and 3002 are divisors of 3002)
  • 3002 / 2 = 1501 (the remainder is 0, so 2 and 1501 are divisors of 3002)
  • 3002 / 3 = 1000.6666666667 (the remainder is 2, so 3 is not a divisor of 3002)
  • ...
  • 3002 / 53 = 56.641509433962 (the remainder is 34, so 53 is not a divisor of 3002)
  • 3002 / 54 = 55.592592592593 (the remainder is 32, so 54 is not a divisor of 3002)