What are the divisors of 6002?

1, 2, 3001, 6002

2 even divisors

2, 6002

2 odd divisors

1, 3001

How to compute the divisors of 6002?

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

  • 6002 / 1 = 6002 (the remainder is 0, so 1 is a divisor of 6002)
  • 6002 / 2 = 3001 (the remainder is 0, so 2 is a divisor of 6002)
  • 6002 / 3 = 2000.6666666667 (the remainder is 2, so 3 is not a divisor of 6002)
  • ...
  • 6002 / 6001 = 1.0001666388935 (the remainder is 1, so 6001 is not a divisor of 6002)
  • 6002 / 6002 = 1 (the remainder is 0, so 6002 is a divisor of 6002)

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 6002 (i.e. 77.472575792986). 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 )

  • 6002 / 1 = 6002 (the remainder is 0, so 1 and 6002 are divisors of 6002)
  • 6002 / 2 = 3001 (the remainder is 0, so 2 and 3001 are divisors of 6002)
  • 6002 / 3 = 2000.6666666667 (the remainder is 2, so 3 is not a divisor of 6002)
  • ...
  • 6002 / 76 = 78.973684210526 (the remainder is 74, so 76 is not a divisor of 6002)
  • 6002 / 77 = 77.948051948052 (the remainder is 73, so 77 is not a divisor of 6002)