What are the divisors of 4060?

1, 2, 4, 5, 7, 10, 14, 20, 28, 29, 35, 58, 70, 116, 140, 145, 203, 290, 406, 580, 812, 1015, 2030, 4060

16 even divisors

2, 4, 10, 14, 20, 28, 58, 70, 116, 140, 290, 406, 580, 812, 2030, 4060

8 odd divisors

1, 5, 7, 29, 35, 145, 203, 1015

How to compute the divisors of 4060?

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

  • 4060 / 1 = 4060 (the remainder is 0, so 1 is a divisor of 4060)
  • 4060 / 2 = 2030 (the remainder is 0, so 2 is a divisor of 4060)
  • 4060 / 3 = 1353.3333333333 (the remainder is 1, so 3 is not a divisor of 4060)
  • ...
  • 4060 / 4059 = 1.0002463661 (the remainder is 1, so 4059 is not a divisor of 4060)
  • 4060 / 4060 = 1 (the remainder is 0, so 4060 is a divisor of 4060)

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 4060 (i.e. 63.718129288296). 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 )

  • 4060 / 1 = 4060 (the remainder is 0, so 1 and 4060 are divisors of 4060)
  • 4060 / 2 = 2030 (the remainder is 0, so 2 and 2030 are divisors of 4060)
  • 4060 / 3 = 1353.3333333333 (the remainder is 1, so 3 is not a divisor of 4060)
  • ...
  • 4060 / 62 = 65.483870967742 (the remainder is 30, so 62 is not a divisor of 4060)
  • 4060 / 63 = 64.444444444444 (the remainder is 28, so 63 is not a divisor of 4060)