What are the divisors of 3906?

1, 2, 3, 6, 7, 9, 14, 18, 21, 31, 42, 62, 63, 93, 126, 186, 217, 279, 434, 558, 651, 1302, 1953, 3906

12 even divisors

2, 6, 14, 18, 42, 62, 126, 186, 434, 558, 1302, 3906

12 odd divisors

1, 3, 7, 9, 21, 31, 63, 93, 217, 279, 651, 1953

How to compute the divisors of 3906?

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

  • 3906 / 1 = 3906 (the remainder is 0, so 1 is a divisor of 3906)
  • 3906 / 2 = 1953 (the remainder is 0, so 2 is a divisor of 3906)
  • 3906 / 3 = 1302 (the remainder is 0, so 3 is a divisor of 3906)
  • ...
  • 3906 / 3905 = 1.0002560819462 (the remainder is 1, so 3905 is not a divisor of 3906)
  • 3906 / 3906 = 1 (the remainder is 0, so 3906 is a divisor of 3906)

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 3906 (i.e. 62.497999967999). 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 )

  • 3906 / 1 = 3906 (the remainder is 0, so 1 and 3906 are divisors of 3906)
  • 3906 / 2 = 1953 (the remainder is 0, so 2 and 1953 are divisors of 3906)
  • 3906 / 3 = 1302 (the remainder is 0, so 3 and 1302 are divisors of 3906)
  • ...
  • 3906 / 61 = 64.032786885246 (the remainder is 2, so 61 is not a divisor of 3906)
  • 3906 / 62 = 63 (the remainder is 0, so 62 and 63 are divisors of 3906)