What are the divisors of 5874?

1, 2, 3, 6, 11, 22, 33, 66, 89, 178, 267, 534, 979, 1958, 2937, 5874

8 even divisors

2, 6, 22, 66, 178, 534, 1958, 5874

8 odd divisors

1, 3, 11, 33, 89, 267, 979, 2937

How to compute the divisors of 5874?

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

  • 5874 / 1 = 5874 (the remainder is 0, so 1 is a divisor of 5874)
  • 5874 / 2 = 2937 (the remainder is 0, so 2 is a divisor of 5874)
  • 5874 / 3 = 1958 (the remainder is 0, so 3 is a divisor of 5874)
  • ...
  • 5874 / 5873 = 1.0001702707305 (the remainder is 1, so 5873 is not a divisor of 5874)
  • 5874 / 5874 = 1 (the remainder is 0, so 5874 is a divisor of 5874)

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 5874 (i.e. 76.642025025439). 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 )

  • 5874 / 1 = 5874 (the remainder is 0, so 1 and 5874 are divisors of 5874)
  • 5874 / 2 = 2937 (the remainder is 0, so 2 and 2937 are divisors of 5874)
  • 5874 / 3 = 1958 (the remainder is 0, so 3 and 1958 are divisors of 5874)
  • ...
  • 5874 / 75 = 78.32 (the remainder is 24, so 75 is not a divisor of 5874)
  • 5874 / 76 = 77.289473684211 (the remainder is 22, so 76 is not a divisor of 5874)