What are the divisors of 1518?

1, 2, 3, 6, 11, 22, 23, 33, 46, 66, 69, 138, 253, 506, 759, 1518

8 even divisors

2, 6, 22, 46, 66, 138, 506, 1518

8 odd divisors

1, 3, 11, 23, 33, 69, 253, 759

How to compute the divisors of 1518?

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

  • 1518 / 1 = 1518 (the remainder is 0, so 1 is a divisor of 1518)
  • 1518 / 2 = 759 (the remainder is 0, so 2 is a divisor of 1518)
  • 1518 / 3 = 506 (the remainder is 0, so 3 is a divisor of 1518)
  • ...
  • 1518 / 1517 = 1.0006591957811 (the remainder is 1, so 1517 is not a divisor of 1518)
  • 1518 / 1518 = 1 (the remainder is 0, so 1518 is a divisor of 1518)

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 1518 (i.e. 38.961519477556). 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 )

  • 1518 / 1 = 1518 (the remainder is 0, so 1 and 1518 are divisors of 1518)
  • 1518 / 2 = 759 (the remainder is 0, so 2 and 759 are divisors of 1518)
  • 1518 / 3 = 506 (the remainder is 0, so 3 and 506 are divisors of 1518)
  • ...
  • 1518 / 37 = 41.027027027027 (the remainder is 1, so 37 is not a divisor of 1518)
  • 1518 / 38 = 39.947368421053 (the remainder is 36, so 38 is not a divisor of 1518)