What are the divisors of 5418?

1, 2, 3, 6, 7, 9, 14, 18, 21, 42, 43, 63, 86, 126, 129, 258, 301, 387, 602, 774, 903, 1806, 2709, 5418

12 even divisors

2, 6, 14, 18, 42, 86, 126, 258, 602, 774, 1806, 5418

12 odd divisors

1, 3, 7, 9, 21, 43, 63, 129, 301, 387, 903, 2709

How to compute the divisors of 5418?

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

  • 5418 / 1 = 5418 (the remainder is 0, so 1 is a divisor of 5418)
  • 5418 / 2 = 2709 (the remainder is 0, so 2 is a divisor of 5418)
  • 5418 / 3 = 1806 (the remainder is 0, so 3 is a divisor of 5418)
  • ...
  • 5418 / 5417 = 1.0001846040244 (the remainder is 1, so 5417 is not a divisor of 5418)
  • 5418 / 5418 = 1 (the remainder is 0, so 5418 is a divisor of 5418)

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 5418 (i.e. 73.607064878312). 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 )

  • 5418 / 1 = 5418 (the remainder is 0, so 1 and 5418 are divisors of 5418)
  • 5418 / 2 = 2709 (the remainder is 0, so 2 and 2709 are divisors of 5418)
  • 5418 / 3 = 1806 (the remainder is 0, so 3 and 1806 are divisors of 5418)
  • ...
  • 5418 / 72 = 75.25 (the remainder is 18, so 72 is not a divisor of 5418)
  • 5418 / 73 = 74.219178082192 (the remainder is 16, so 73 is not a divisor of 5418)