What are the divisors of 1672?

1, 2, 4, 8, 11, 19, 22, 38, 44, 76, 88, 152, 209, 418, 836, 1672

12 even divisors

2, 4, 8, 22, 38, 44, 76, 88, 152, 418, 836, 1672

4 odd divisors

1, 11, 19, 209

How to compute the divisors of 1672?

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

  • 1672 / 1 = 1672 (the remainder is 0, so 1 is a divisor of 1672)
  • 1672 / 2 = 836 (the remainder is 0, so 2 is a divisor of 1672)
  • 1672 / 3 = 557.33333333333 (the remainder is 1, so 3 is not a divisor of 1672)
  • ...
  • 1672 / 1671 = 1.0005984440455 (the remainder is 1, so 1671 is not a divisor of 1672)
  • 1672 / 1672 = 1 (the remainder is 0, so 1672 is a divisor of 1672)

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 1672 (i.e. 40.890096600522). 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 )

  • 1672 / 1 = 1672 (the remainder is 0, so 1 and 1672 are divisors of 1672)
  • 1672 / 2 = 836 (the remainder is 0, so 2 and 836 are divisors of 1672)
  • 1672 / 3 = 557.33333333333 (the remainder is 1, so 3 is not a divisor of 1672)
  • ...
  • 1672 / 39 = 42.871794871795 (the remainder is 34, so 39 is not a divisor of 1672)
  • 1672 / 40 = 41.8 (the remainder is 32, so 40 is not a divisor of 1672)