What are the divisors of 5790?

1, 2, 3, 5, 6, 10, 15, 30, 193, 386, 579, 965, 1158, 1930, 2895, 5790

8 even divisors

2, 6, 10, 30, 386, 1158, 1930, 5790

8 odd divisors

1, 3, 5, 15, 193, 579, 965, 2895

How to compute the divisors of 5790?

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

  • 5790 / 1 = 5790 (the remainder is 0, so 1 is a divisor of 5790)
  • 5790 / 2 = 2895 (the remainder is 0, so 2 is a divisor of 5790)
  • 5790 / 3 = 1930 (the remainder is 0, so 3 is a divisor of 5790)
  • ...
  • 5790 / 5789 = 1.0001727414061 (the remainder is 1, so 5789 is not a divisor of 5790)
  • 5790 / 5790 = 1 (the remainder is 0, so 5790 is a divisor of 5790)

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 5790 (i.e. 76.092049518987). 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 )

  • 5790 / 1 = 5790 (the remainder is 0, so 1 and 5790 are divisors of 5790)
  • 5790 / 2 = 2895 (the remainder is 0, so 2 and 2895 are divisors of 5790)
  • 5790 / 3 = 1930 (the remainder is 0, so 3 and 1930 are divisors of 5790)
  • ...
  • 5790 / 75 = 77.2 (the remainder is 15, so 75 is not a divisor of 5790)
  • 5790 / 76 = 76.184210526316 (the remainder is 14, so 76 is not a divisor of 5790)