What are the divisors of 4518?

1, 2, 3, 6, 9, 18, 251, 502, 753, 1506, 2259, 4518

6 even divisors

2, 6, 18, 502, 1506, 4518

6 odd divisors

1, 3, 9, 251, 753, 2259

How to compute the divisors of 4518?

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

  • 4518 / 1 = 4518 (the remainder is 0, so 1 is a divisor of 4518)
  • 4518 / 2 = 2259 (the remainder is 0, so 2 is a divisor of 4518)
  • 4518 / 3 = 1506 (the remainder is 0, so 3 is a divisor of 4518)
  • ...
  • 4518 / 4517 = 1.0002213858756 (the remainder is 1, so 4517 is not a divisor of 4518)
  • 4518 / 4518 = 1 (the remainder is 0, so 4518 is a divisor of 4518)

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 4518 (i.e. 67.216069507224). 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 )

  • 4518 / 1 = 4518 (the remainder is 0, so 1 and 4518 are divisors of 4518)
  • 4518 / 2 = 2259 (the remainder is 0, so 2 and 2259 are divisors of 4518)
  • 4518 / 3 = 1506 (the remainder is 0, so 3 and 1506 are divisors of 4518)
  • ...
  • 4518 / 66 = 68.454545454545 (the remainder is 30, so 66 is not a divisor of 4518)
  • 4518 / 67 = 67.432835820896 (the remainder is 29, so 67 is not a divisor of 4518)