What are the divisors of 5742?

1, 2, 3, 6, 9, 11, 18, 22, 29, 33, 58, 66, 87, 99, 174, 198, 261, 319, 522, 638, 957, 1914, 2871, 5742

12 even divisors

2, 6, 18, 22, 58, 66, 174, 198, 522, 638, 1914, 5742

12 odd divisors

1, 3, 9, 11, 29, 33, 87, 99, 261, 319, 957, 2871

How to compute the divisors of 5742?

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

  • 5742 / 1 = 5742 (the remainder is 0, so 1 is a divisor of 5742)
  • 5742 / 2 = 2871 (the remainder is 0, so 2 is a divisor of 5742)
  • 5742 / 3 = 1914 (the remainder is 0, so 3 is a divisor of 5742)
  • ...
  • 5742 / 5741 = 1.0001741856819 (the remainder is 1, so 5741 is not a divisor of 5742)
  • 5742 / 5742 = 1 (the remainder is 0, so 5742 is a divisor of 5742)

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 5742 (i.e. 75.775985641891). 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 )

  • 5742 / 1 = 5742 (the remainder is 0, so 1 and 5742 are divisors of 5742)
  • 5742 / 2 = 2871 (the remainder is 0, so 2 and 2871 are divisors of 5742)
  • 5742 / 3 = 1914 (the remainder is 0, so 3 and 1914 are divisors of 5742)
  • ...
  • 5742 / 74 = 77.594594594595 (the remainder is 44, so 74 is not a divisor of 5742)
  • 5742 / 75 = 76.56 (the remainder is 42, so 75 is not a divisor of 5742)