What are the divisors of 5814?

1, 2, 3, 6, 9, 17, 18, 19, 34, 38, 51, 57, 102, 114, 153, 171, 306, 323, 342, 646, 969, 1938, 2907, 5814

12 even divisors

2, 6, 18, 34, 38, 102, 114, 306, 342, 646, 1938, 5814

12 odd divisors

1, 3, 9, 17, 19, 51, 57, 153, 171, 323, 969, 2907

How to compute the divisors of 5814?

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

  • 5814 / 1 = 5814 (the remainder is 0, so 1 is a divisor of 5814)
  • 5814 / 2 = 2907 (the remainder is 0, so 2 is a divisor of 5814)
  • 5814 / 3 = 1938 (the remainder is 0, so 3 is a divisor of 5814)
  • ...
  • 5814 / 5813 = 1.0001720282126 (the remainder is 1, so 5813 is not a divisor of 5814)
  • 5814 / 5814 = 1 (the remainder is 0, so 5814 is a divisor of 5814)

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 5814 (i.e. 76.249590162833). 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 )

  • 5814 / 1 = 5814 (the remainder is 0, so 1 and 5814 are divisors of 5814)
  • 5814 / 2 = 2907 (the remainder is 0, so 2 and 2907 are divisors of 5814)
  • 5814 / 3 = 1938 (the remainder is 0, so 3 and 1938 are divisors of 5814)
  • ...
  • 5814 / 75 = 77.52 (the remainder is 39, so 75 is not a divisor of 5814)
  • 5814 / 76 = 76.5 (the remainder is 38, so 76 is not a divisor of 5814)