What are the divisors of 5868?

1, 2, 3, 4, 6, 9, 12, 18, 36, 163, 326, 489, 652, 978, 1467, 1956, 2934, 5868

12 even divisors

2, 4, 6, 12, 18, 36, 326, 652, 978, 1956, 2934, 5868

6 odd divisors

1, 3, 9, 163, 489, 1467

How to compute the divisors of 5868?

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

  • 5868 / 1 = 5868 (the remainder is 0, so 1 is a divisor of 5868)
  • 5868 / 2 = 2934 (the remainder is 0, so 2 is a divisor of 5868)
  • 5868 / 3 = 1956 (the remainder is 0, so 3 is a divisor of 5868)
  • ...
  • 5868 / 5867 = 1.0001704448611 (the remainder is 1, so 5867 is not a divisor of 5868)
  • 5868 / 5868 = 1 (the remainder is 0, so 5868 is a divisor of 5868)

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 5868 (i.e. 76.602872008822). 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 )

  • 5868 / 1 = 5868 (the remainder is 0, so 1 and 5868 are divisors of 5868)
  • 5868 / 2 = 2934 (the remainder is 0, so 2 and 2934 are divisors of 5868)
  • 5868 / 3 = 1956 (the remainder is 0, so 3 and 1956 are divisors of 5868)
  • ...
  • 5868 / 75 = 78.24 (the remainder is 18, so 75 is not a divisor of 5868)
  • 5868 / 76 = 77.210526315789 (the remainder is 16, so 76 is not a divisor of 5868)