What are the divisors of 6140?

1, 2, 4, 5, 10, 20, 307, 614, 1228, 1535, 3070, 6140

8 even divisors

2, 4, 10, 20, 614, 1228, 3070, 6140

4 odd divisors

1, 5, 307, 1535

How to compute the divisors of 6140?

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

  • 6140 / 1 = 6140 (the remainder is 0, so 1 is a divisor of 6140)
  • 6140 / 2 = 3070 (the remainder is 0, so 2 is a divisor of 6140)
  • 6140 / 3 = 2046.6666666667 (the remainder is 2, so 3 is not a divisor of 6140)
  • ...
  • 6140 / 6139 = 1.0001628929793 (the remainder is 1, so 6139 is not a divisor of 6140)
  • 6140 / 6140 = 1 (the remainder is 0, so 6140 is a divisor of 6140)

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 6140 (i.e. 78.358152096639). 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 )

  • 6140 / 1 = 6140 (the remainder is 0, so 1 and 6140 are divisors of 6140)
  • 6140 / 2 = 3070 (the remainder is 0, so 2 and 3070 are divisors of 6140)
  • 6140 / 3 = 2046.6666666667 (the remainder is 2, so 3 is not a divisor of 6140)
  • ...
  • 6140 / 77 = 79.74025974026 (the remainder is 57, so 77 is not a divisor of 6140)
  • 6140 / 78 = 78.717948717949 (the remainder is 56, so 78 is not a divisor of 6140)