What are the divisors of 4872?

1, 2, 3, 4, 6, 7, 8, 12, 14, 21, 24, 28, 29, 42, 56, 58, 84, 87, 116, 168, 174, 203, 232, 348, 406, 609, 696, 812, 1218, 1624, 2436, 4872

24 even divisors

2, 4, 6, 8, 12, 14, 24, 28, 42, 56, 58, 84, 116, 168, 174, 232, 348, 406, 696, 812, 1218, 1624, 2436, 4872

8 odd divisors

1, 3, 7, 21, 29, 87, 203, 609

How to compute the divisors of 4872?

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

  • 4872 / 1 = 4872 (the remainder is 0, so 1 is a divisor of 4872)
  • 4872 / 2 = 2436 (the remainder is 0, so 2 is a divisor of 4872)
  • 4872 / 3 = 1624 (the remainder is 0, so 3 is a divisor of 4872)
  • ...
  • 4872 / 4871 = 1.0002052966537 (the remainder is 1, so 4871 is not a divisor of 4872)
  • 4872 / 4872 = 1 (the remainder is 0, so 4872 is a divisor of 4872)

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 4872 (i.e. 69.799713466461). 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 )

  • 4872 / 1 = 4872 (the remainder is 0, so 1 and 4872 are divisors of 4872)
  • 4872 / 2 = 2436 (the remainder is 0, so 2 and 2436 are divisors of 4872)
  • 4872 / 3 = 1624 (the remainder is 0, so 3 and 1624 are divisors of 4872)
  • ...
  • 4872 / 68 = 71.647058823529 (the remainder is 44, so 68 is not a divisor of 4872)
  • 4872 / 69 = 70.608695652174 (the remainder is 42, so 69 is not a divisor of 4872)