What are the divisors of 1508?

1, 2, 4, 13, 26, 29, 52, 58, 116, 377, 754, 1508

8 even divisors

2, 4, 26, 52, 58, 116, 754, 1508

4 odd divisors

1, 13, 29, 377

How to compute the divisors of 1508?

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

  • 1508 / 1 = 1508 (the remainder is 0, so 1 is a divisor of 1508)
  • 1508 / 2 = 754 (the remainder is 0, so 2 is a divisor of 1508)
  • 1508 / 3 = 502.66666666667 (the remainder is 2, so 3 is not a divisor of 1508)
  • ...
  • 1508 / 1507 = 1.0006635700066 (the remainder is 1, so 1507 is not a divisor of 1508)
  • 1508 / 1508 = 1 (the remainder is 0, so 1508 is a divisor of 1508)

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 1508 (i.e. 38.832975677895). 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 )

  • 1508 / 1 = 1508 (the remainder is 0, so 1 and 1508 are divisors of 1508)
  • 1508 / 2 = 754 (the remainder is 0, so 2 and 754 are divisors of 1508)
  • 1508 / 3 = 502.66666666667 (the remainder is 2, so 3 is not a divisor of 1508)
  • ...
  • 1508 / 37 = 40.756756756757 (the remainder is 28, so 37 is not a divisor of 1508)
  • 1508 / 38 = 39.684210526316 (the remainder is 26, so 38 is not a divisor of 1508)