What are the divisors of 3978?

1, 2, 3, 6, 9, 13, 17, 18, 26, 34, 39, 51, 78, 102, 117, 153, 221, 234, 306, 442, 663, 1326, 1989, 3978

12 even divisors

2, 6, 18, 26, 34, 78, 102, 234, 306, 442, 1326, 3978

12 odd divisors

1, 3, 9, 13, 17, 39, 51, 117, 153, 221, 663, 1989

How to compute the divisors of 3978?

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

  • 3978 / 1 = 3978 (the remainder is 0, so 1 is a divisor of 3978)
  • 3978 / 2 = 1989 (the remainder is 0, so 2 is a divisor of 3978)
  • 3978 / 3 = 1326 (the remainder is 0, so 3 is a divisor of 3978)
  • ...
  • 3978 / 3977 = 1.0002514458134 (the remainder is 1, so 3977 is not a divisor of 3978)
  • 3978 / 3978 = 1 (the remainder is 0, so 3978 is a divisor of 3978)

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 3978 (i.e. 63.071388124886). 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 )

  • 3978 / 1 = 3978 (the remainder is 0, so 1 and 3978 are divisors of 3978)
  • 3978 / 2 = 1989 (the remainder is 0, so 2 and 1989 are divisors of 3978)
  • 3978 / 3 = 1326 (the remainder is 0, so 3 and 1326 are divisors of 3978)
  • ...
  • 3978 / 62 = 64.161290322581 (the remainder is 10, so 62 is not a divisor of 3978)
  • 3978 / 63 = 63.142857142857 (the remainder is 9, so 63 is not a divisor of 3978)