What are the divisors of 4014?

1, 2, 3, 6, 9, 18, 223, 446, 669, 1338, 2007, 4014

6 even divisors

2, 6, 18, 446, 1338, 4014

6 odd divisors

1, 3, 9, 223, 669, 2007

How to compute the divisors of 4014?

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

  • 4014 / 1 = 4014 (the remainder is 0, so 1 is a divisor of 4014)
  • 4014 / 2 = 2007 (the remainder is 0, so 2 is a divisor of 4014)
  • 4014 / 3 = 1338 (the remainder is 0, so 3 is a divisor of 4014)
  • ...
  • 4014 / 4013 = 1.0002491901321 (the remainder is 1, so 4013 is not a divisor of 4014)
  • 4014 / 4014 = 1 (the remainder is 0, so 4014 is a divisor of 4014)

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 4014 (i.e. 63.356136245829). 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 )

  • 4014 / 1 = 4014 (the remainder is 0, so 1 and 4014 are divisors of 4014)
  • 4014 / 2 = 2007 (the remainder is 0, so 2 and 2007 are divisors of 4014)
  • 4014 / 3 = 1338 (the remainder is 0, so 3 and 1338 are divisors of 4014)
  • ...
  • 4014 / 62 = 64.741935483871 (the remainder is 46, so 62 is not a divisor of 4014)
  • 4014 / 63 = 63.714285714286 (the remainder is 45, so 63 is not a divisor of 4014)