What are the divisors of 6040?

1, 2, 4, 5, 8, 10, 20, 40, 151, 302, 604, 755, 1208, 1510, 3020, 6040

12 even divisors

2, 4, 8, 10, 20, 40, 302, 604, 1208, 1510, 3020, 6040

4 odd divisors

1, 5, 151, 755

How to compute the divisors of 6040?

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

  • 6040 / 1 = 6040 (the remainder is 0, so 1 is a divisor of 6040)
  • 6040 / 2 = 3020 (the remainder is 0, so 2 is a divisor of 6040)
  • 6040 / 3 = 2013.3333333333 (the remainder is 1, so 3 is not a divisor of 6040)
  • ...
  • 6040 / 6039 = 1.0001655903295 (the remainder is 1, so 6039 is not a divisor of 6040)
  • 6040 / 6040 = 1 (the remainder is 0, so 6040 is a divisor of 6040)

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 6040 (i.e. 77.717436910902). 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 )

  • 6040 / 1 = 6040 (the remainder is 0, so 1 and 6040 are divisors of 6040)
  • 6040 / 2 = 3020 (the remainder is 0, so 2 and 3020 are divisors of 6040)
  • 6040 / 3 = 2013.3333333333 (the remainder is 1, so 3 is not a divisor of 6040)
  • ...
  • 6040 / 76 = 79.473684210526 (the remainder is 36, so 76 is not a divisor of 6040)
  • 6040 / 77 = 78.441558441558 (the remainder is 34, so 77 is not a divisor of 6040)