What are the divisors of 5076?

1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 47, 54, 94, 108, 141, 188, 282, 423, 564, 846, 1269, 1692, 2538, 5076

16 even divisors

2, 4, 6, 12, 18, 36, 54, 94, 108, 188, 282, 564, 846, 1692, 2538, 5076

8 odd divisors

1, 3, 9, 27, 47, 141, 423, 1269

How to compute the divisors of 5076?

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

  • 5076 / 1 = 5076 (the remainder is 0, so 1 is a divisor of 5076)
  • 5076 / 2 = 2538 (the remainder is 0, so 2 is a divisor of 5076)
  • 5076 / 3 = 1692 (the remainder is 0, so 3 is a divisor of 5076)
  • ...
  • 5076 / 5075 = 1.000197044335 (the remainder is 1, so 5075 is not a divisor of 5076)
  • 5076 / 5076 = 1 (the remainder is 0, so 5076 is a divisor of 5076)

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 5076 (i.e. 71.246052522228). 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 )

  • 5076 / 1 = 5076 (the remainder is 0, so 1 and 5076 are divisors of 5076)
  • 5076 / 2 = 2538 (the remainder is 0, so 2 and 2538 are divisors of 5076)
  • 5076 / 3 = 1692 (the remainder is 0, so 3 and 1692 are divisors of 5076)
  • ...
  • 5076 / 70 = 72.514285714286 (the remainder is 36, so 70 is not a divisor of 5076)
  • 5076 / 71 = 71.492957746479 (the remainder is 35, so 71 is not a divisor of 5076)