What are the divisors of 10000?

1, 2, 4, 5, 8, 10, 16, 20, 25, 40, 50, 80, 100, 125, 200, 250, 400, 500, 625, 1000, 1250, 2000, 2500, 5000, 10000

20 even divisors

2, 4, 8, 10, 16, 20, 40, 50, 80, 100, 200, 250, 400, 500, 1000, 1250, 2000, 2500, 5000, 10000

5 odd divisors

1, 5, 25, 125, 625

How to compute the divisors of 10000?

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

  • 10000 / 1 = 10000 (the remainder is 0, so 1 is a divisor of 10000)
  • 10000 / 2 = 5000 (the remainder is 0, so 2 is a divisor of 10000)
  • 10000 / 3 = 3333.3333333333 (the remainder is 1, so 3 is not a divisor of 10000)
  • ...
  • 10000 / 9999 = 1.000100010001 (the remainder is 1, so 9999 is not a divisor of 10000)
  • 10000 / 10000 = 1 (the remainder is 0, so 10000 is a divisor of 10000)

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 10000 (i.e. 100). 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 )

  • 10000 / 1 = 10000 (the remainder is 0, so 1 and 10000 are divisors of 10000)
  • 10000 / 2 = 5000 (the remainder is 0, so 2 and 5000 are divisors of 10000)
  • 10000 / 3 = 3333.3333333333 (the remainder is 1, so 3 is not a divisor of 10000)
  • ...
  • 10000 / 99 = 101.0101010101 (the remainder is 1, so 99 is not a divisor of 10000)
  • 10000 / 100 = 100 (the remainder is 0, so 100 and 100 are divisors of 10000)