What are the divisors of 5865?

1, 3, 5, 15, 17, 23, 51, 69, 85, 115, 255, 345, 391, 1173, 1955, 5865

16 odd divisors

1, 3, 5, 15, 17, 23, 51, 69, 85, 115, 255, 345, 391, 1173, 1955, 5865

How to compute the divisors of 5865?

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

  • 5865 / 1 = 5865 (the remainder is 0, so 1 is a divisor of 5865)
  • 5865 / 2 = 2932.5 (the remainder is 1, so 2 is not a divisor of 5865)
  • 5865 / 3 = 1955 (the remainder is 0, so 3 is a divisor of 5865)
  • ...
  • 5865 / 5864 = 1.00017053206 (the remainder is 1, so 5864 is not a divisor of 5865)
  • 5865 / 5865 = 1 (the remainder is 0, so 5865 is a divisor of 5865)

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 5865 (i.e. 76.583287994183). 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 )

  • 5865 / 1 = 5865 (the remainder is 0, so 1 and 5865 are divisors of 5865)
  • 5865 / 2 = 2932.5 (the remainder is 1, so 2 is not a divisor of 5865)
  • 5865 / 3 = 1955 (the remainder is 0, so 3 and 1955 are divisors of 5865)
  • ...
  • 5865 / 75 = 78.2 (the remainder is 15, so 75 is not a divisor of 5865)
  • 5865 / 76 = 77.171052631579 (the remainder is 13, so 76 is not a divisor of 5865)