What are the divisors of 1560?

1, 2, 3, 4, 5, 6, 8, 10, 12, 13, 15, 20, 24, 26, 30, 39, 40, 52, 60, 65, 78, 104, 120, 130, 156, 195, 260, 312, 390, 520, 780, 1560

24 even divisors

2, 4, 6, 8, 10, 12, 20, 24, 26, 30, 40, 52, 60, 78, 104, 120, 130, 156, 260, 312, 390, 520, 780, 1560

8 odd divisors

1, 3, 5, 13, 15, 39, 65, 195

How to compute the divisors of 1560?

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

  • 1560 / 1 = 1560 (the remainder is 0, so 1 is a divisor of 1560)
  • 1560 / 2 = 780 (the remainder is 0, so 2 is a divisor of 1560)
  • 1560 / 3 = 520 (the remainder is 0, so 3 is a divisor of 1560)
  • ...
  • 1560 / 1559 = 1.0006414368185 (the remainder is 1, so 1559 is not a divisor of 1560)
  • 1560 / 1560 = 1 (the remainder is 0, so 1560 is a divisor of 1560)

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 1560 (i.e. 39.496835316263). 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 )

  • 1560 / 1 = 1560 (the remainder is 0, so 1 and 1560 are divisors of 1560)
  • 1560 / 2 = 780 (the remainder is 0, so 2 and 780 are divisors of 1560)
  • 1560 / 3 = 520 (the remainder is 0, so 3 and 520 are divisors of 1560)
  • ...
  • 1560 / 38 = 41.052631578947 (the remainder is 2, so 38 is not a divisor of 1560)
  • 1560 / 39 = 40 (the remainder is 0, so 39 and 40 are divisors of 1560)