What are the divisors of 1974?

1, 2, 3, 6, 7, 14, 21, 42, 47, 94, 141, 282, 329, 658, 987, 1974

8 even divisors

2, 6, 14, 42, 94, 282, 658, 1974

8 odd divisors

1, 3, 7, 21, 47, 141, 329, 987

How to compute the divisors of 1974?

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

  • 1974 / 1 = 1974 (the remainder is 0, so 1 is a divisor of 1974)
  • 1974 / 2 = 987 (the remainder is 0, so 2 is a divisor of 1974)
  • 1974 / 3 = 658 (the remainder is 0, so 3 is a divisor of 1974)
  • ...
  • 1974 / 1973 = 1.000506842372 (the remainder is 1, so 1973 is not a divisor of 1974)
  • 1974 / 1974 = 1 (the remainder is 0, so 1974 is a divisor of 1974)

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 1974 (i.e. 44.429719783046). 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 )

  • 1974 / 1 = 1974 (the remainder is 0, so 1 and 1974 are divisors of 1974)
  • 1974 / 2 = 987 (the remainder is 0, so 2 and 987 are divisors of 1974)
  • 1974 / 3 = 658 (the remainder is 0, so 3 and 658 are divisors of 1974)
  • ...
  • 1974 / 43 = 45.906976744186 (the remainder is 39, so 43 is not a divisor of 1974)
  • 1974 / 44 = 44.863636363636 (the remainder is 38, so 44 is not a divisor of 1974)