What are the divisors of 3894?

1, 2, 3, 6, 11, 22, 33, 59, 66, 118, 177, 354, 649, 1298, 1947, 3894

8 even divisors

2, 6, 22, 66, 118, 354, 1298, 3894

8 odd divisors

1, 3, 11, 33, 59, 177, 649, 1947

How to compute the divisors of 3894?

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

  • 3894 / 1 = 3894 (the remainder is 0, so 1 is a divisor of 3894)
  • 3894 / 2 = 1947 (the remainder is 0, so 2 is a divisor of 3894)
  • 3894 / 3 = 1298 (the remainder is 0, so 3 is a divisor of 3894)
  • ...
  • 3894 / 3893 = 1.0002568713075 (the remainder is 1, so 3893 is not a divisor of 3894)
  • 3894 / 3894 = 1 (the remainder is 0, so 3894 is a divisor of 3894)

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 3894 (i.e. 62.401923047291). 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 )

  • 3894 / 1 = 3894 (the remainder is 0, so 1 and 3894 are divisors of 3894)
  • 3894 / 2 = 1947 (the remainder is 0, so 2 and 1947 are divisors of 3894)
  • 3894 / 3 = 1298 (the remainder is 0, so 3 and 1298 are divisors of 3894)
  • ...
  • 3894 / 61 = 63.83606557377 (the remainder is 51, so 61 is not a divisor of 3894)
  • 3894 / 62 = 62.806451612903 (the remainder is 50, so 62 is not a divisor of 3894)