What are the divisors of 1386?

1, 2, 3, 6, 7, 9, 11, 14, 18, 21, 22, 33, 42, 63, 66, 77, 99, 126, 154, 198, 231, 462, 693, 1386

12 even divisors

2, 6, 14, 18, 22, 42, 66, 126, 154, 198, 462, 1386

12 odd divisors

1, 3, 7, 9, 11, 21, 33, 63, 77, 99, 231, 693

How to compute the divisors of 1386?

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

  • 1386 / 1 = 1386 (the remainder is 0, so 1 is a divisor of 1386)
  • 1386 / 2 = 693 (the remainder is 0, so 2 is a divisor of 1386)
  • 1386 / 3 = 462 (the remainder is 0, so 3 is a divisor of 1386)
  • ...
  • 1386 / 1385 = 1.0007220216606 (the remainder is 1, so 1385 is not a divisor of 1386)
  • 1386 / 1386 = 1 (the remainder is 0, so 1386 is a divisor of 1386)

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 1386 (i.e. 37.229020937973). 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 )

  • 1386 / 1 = 1386 (the remainder is 0, so 1 and 1386 are divisors of 1386)
  • 1386 / 2 = 693 (the remainder is 0, so 2 and 693 are divisors of 1386)
  • 1386 / 3 = 462 (the remainder is 0, so 3 and 462 are divisors of 1386)
  • ...
  • 1386 / 36 = 38.5 (the remainder is 18, so 36 is not a divisor of 1386)
  • 1386 / 37 = 37.459459459459 (the remainder is 17, so 37 is not a divisor of 1386)