What are the divisors of 4140?

1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 23, 30, 36, 45, 46, 60, 69, 90, 92, 115, 138, 180, 207, 230, 276, 345, 414, 460, 690, 828, 1035, 1380, 2070, 4140

24 even divisors

2, 4, 6, 10, 12, 18, 20, 30, 36, 46, 60, 90, 92, 138, 180, 230, 276, 414, 460, 690, 828, 1380, 2070, 4140

12 odd divisors

1, 3, 5, 9, 15, 23, 45, 69, 115, 207, 345, 1035

How to compute the divisors of 4140?

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

  • 4140 / 1 = 4140 (the remainder is 0, so 1 is a divisor of 4140)
  • 4140 / 2 = 2070 (the remainder is 0, so 2 is a divisor of 4140)
  • 4140 / 3 = 1380 (the remainder is 0, so 3 is a divisor of 4140)
  • ...
  • 4140 / 4139 = 1.0002416042522 (the remainder is 1, so 4139 is not a divisor of 4140)
  • 4140 / 4140 = 1 (the remainder is 0, so 4140 is a divisor of 4140)

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 4140 (i.e. 64.342831768582). 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 )

  • 4140 / 1 = 4140 (the remainder is 0, so 1 and 4140 are divisors of 4140)
  • 4140 / 2 = 2070 (the remainder is 0, so 2 and 2070 are divisors of 4140)
  • 4140 / 3 = 1380 (the remainder is 0, so 3 and 1380 are divisors of 4140)
  • ...
  • 4140 / 63 = 65.714285714286 (the remainder is 45, so 63 is not a divisor of 4140)
  • 4140 / 64 = 64.6875 (the remainder is 44, so 64 is not a divisor of 4140)