What are the divisors of 1576?

1, 2, 4, 8, 197, 394, 788, 1576

6 even divisors

2, 4, 8, 394, 788, 1576

2 odd divisors

1, 197

How to compute the divisors of 1576?

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

  • 1576 / 1 = 1576 (the remainder is 0, so 1 is a divisor of 1576)
  • 1576 / 2 = 788 (the remainder is 0, so 2 is a divisor of 1576)
  • 1576 / 3 = 525.33333333333 (the remainder is 1, so 3 is not a divisor of 1576)
  • ...
  • 1576 / 1575 = 1.0006349206349 (the remainder is 1, so 1575 is not a divisor of 1576)
  • 1576 / 1576 = 1 (the remainder is 0, so 1576 is a divisor of 1576)

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 1576 (i.e. 39.698866482558). 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 )

  • 1576 / 1 = 1576 (the remainder is 0, so 1 and 1576 are divisors of 1576)
  • 1576 / 2 = 788 (the remainder is 0, so 2 and 788 are divisors of 1576)
  • 1576 / 3 = 525.33333333333 (the remainder is 1, so 3 is not a divisor of 1576)
  • ...
  • 1576 / 38 = 41.473684210526 (the remainder is 18, so 38 is not a divisor of 1576)
  • 1576 / 39 = 40.410256410256 (the remainder is 16, so 39 is not a divisor of 1576)