What are the divisors of 5200?

1, 2, 4, 5, 8, 10, 13, 16, 20, 25, 26, 40, 50, 52, 65, 80, 100, 104, 130, 200, 208, 260, 325, 400, 520, 650, 1040, 1300, 2600, 5200

24 even divisors

2, 4, 8, 10, 16, 20, 26, 40, 50, 52, 80, 100, 104, 130, 200, 208, 260, 400, 520, 650, 1040, 1300, 2600, 5200

6 odd divisors

1, 5, 13, 25, 65, 325

How to compute the divisors of 5200?

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

  • 5200 / 1 = 5200 (the remainder is 0, so 1 is a divisor of 5200)
  • 5200 / 2 = 2600 (the remainder is 0, so 2 is a divisor of 5200)
  • 5200 / 3 = 1733.3333333333 (the remainder is 1, so 3 is not a divisor of 5200)
  • ...
  • 5200 / 5199 = 1.0001923446817 (the remainder is 1, so 5199 is not a divisor of 5200)
  • 5200 / 5200 = 1 (the remainder is 0, so 5200 is a divisor of 5200)

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 5200 (i.e. 72.11102550928). 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 )

  • 5200 / 1 = 5200 (the remainder is 0, so 1 and 5200 are divisors of 5200)
  • 5200 / 2 = 2600 (the remainder is 0, so 2 and 2600 are divisors of 5200)
  • 5200 / 3 = 1733.3333333333 (the remainder is 1, so 3 is not a divisor of 5200)
  • ...
  • 5200 / 71 = 73.239436619718 (the remainder is 17, so 71 is not a divisor of 5200)
  • 5200 / 72 = 72.222222222222 (the remainder is 16, so 72 is not a divisor of 5200)