What are the divisors of 1662?

1, 2, 3, 6, 277, 554, 831, 1662

4 even divisors

2, 6, 554, 1662

4 odd divisors

1, 3, 277, 831

How to compute the divisors of 1662?

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

  • 1662 / 1 = 1662 (the remainder is 0, so 1 is a divisor of 1662)
  • 1662 / 2 = 831 (the remainder is 0, so 2 is a divisor of 1662)
  • 1662 / 3 = 554 (the remainder is 0, so 3 is a divisor of 1662)
  • ...
  • 1662 / 1661 = 1.0006020469597 (the remainder is 1, so 1661 is not a divisor of 1662)
  • 1662 / 1662 = 1 (the remainder is 0, so 1662 is a divisor of 1662)

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 1662 (i.e. 40.767634221279). 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 )

  • 1662 / 1 = 1662 (the remainder is 0, so 1 and 1662 are divisors of 1662)
  • 1662 / 2 = 831 (the remainder is 0, so 2 and 831 are divisors of 1662)
  • 1662 / 3 = 554 (the remainder is 0, so 3 and 554 are divisors of 1662)
  • ...
  • 1662 / 39 = 42.615384615385 (the remainder is 24, so 39 is not a divisor of 1662)
  • 1662 / 40 = 41.55 (the remainder is 22, so 40 is not a divisor of 1662)