What are the divisors of 2508?

1, 2, 3, 4, 6, 11, 12, 19, 22, 33, 38, 44, 57, 66, 76, 114, 132, 209, 228, 418, 627, 836, 1254, 2508

16 even divisors

2, 4, 6, 12, 22, 38, 44, 66, 76, 114, 132, 228, 418, 836, 1254, 2508

8 odd divisors

1, 3, 11, 19, 33, 57, 209, 627

How to compute the divisors of 2508?

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

  • 2508 / 1 = 2508 (the remainder is 0, so 1 is a divisor of 2508)
  • 2508 / 2 = 1254 (the remainder is 0, so 2 is a divisor of 2508)
  • 2508 / 3 = 836 (the remainder is 0, so 3 is a divisor of 2508)
  • ...
  • 2508 / 2507 = 1.0003988831272 (the remainder is 1, so 2507 is not a divisor of 2508)
  • 2508 / 2508 = 1 (the remainder is 0, so 2508 is a divisor of 2508)

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 2508 (i.e. 50.079936102196). 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 )

  • 2508 / 1 = 2508 (the remainder is 0, so 1 and 2508 are divisors of 2508)
  • 2508 / 2 = 1254 (the remainder is 0, so 2 and 1254 are divisors of 2508)
  • 2508 / 3 = 836 (the remainder is 0, so 3 and 836 are divisors of 2508)
  • ...
  • 2508 / 49 = 51.183673469388 (the remainder is 9, so 49 is not a divisor of 2508)
  • 2508 / 50 = 50.16 (the remainder is 8, so 50 is not a divisor of 2508)