What are the divisors of 1782?

1, 2, 3, 6, 9, 11, 18, 22, 27, 33, 54, 66, 81, 99, 162, 198, 297, 594, 891, 1782

10 even divisors

2, 6, 18, 22, 54, 66, 162, 198, 594, 1782

10 odd divisors

1, 3, 9, 11, 27, 33, 81, 99, 297, 891

How to compute the divisors of 1782?

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

  • 1782 / 1 = 1782 (the remainder is 0, so 1 is a divisor of 1782)
  • 1782 / 2 = 891 (the remainder is 0, so 2 is a divisor of 1782)
  • 1782 / 3 = 594 (the remainder is 0, so 3 is a divisor of 1782)
  • ...
  • 1782 / 1781 = 1.0005614823133 (the remainder is 1, so 1781 is not a divisor of 1782)
  • 1782 / 1782 = 1 (the remainder is 0, so 1782 is a divisor of 1782)

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 1782 (i.e. 42.213741838411). 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 )

  • 1782 / 1 = 1782 (the remainder is 0, so 1 and 1782 are divisors of 1782)
  • 1782 / 2 = 891 (the remainder is 0, so 2 and 891 are divisors of 1782)
  • 1782 / 3 = 594 (the remainder is 0, so 3 and 594 are divisors of 1782)
  • ...
  • 1782 / 41 = 43.463414634146 (the remainder is 19, so 41 is not a divisor of 1782)
  • 1782 / 42 = 42.428571428571 (the remainder is 18, so 42 is not a divisor of 1782)