What are the divisors of 2128?

1, 2, 4, 7, 8, 14, 16, 19, 28, 38, 56, 76, 112, 133, 152, 266, 304, 532, 1064, 2128

16 even divisors

2, 4, 8, 14, 16, 28, 38, 56, 76, 112, 152, 266, 304, 532, 1064, 2128

4 odd divisors

1, 7, 19, 133

How to compute the divisors of 2128?

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

  • 2128 / 1 = 2128 (the remainder is 0, so 1 is a divisor of 2128)
  • 2128 / 2 = 1064 (the remainder is 0, so 2 is a divisor of 2128)
  • 2128 / 3 = 709.33333333333 (the remainder is 1, so 3 is not a divisor of 2128)
  • ...
  • 2128 / 2127 = 1.0004701457452 (the remainder is 1, so 2127 is not a divisor of 2128)
  • 2128 / 2128 = 1 (the remainder is 0, so 2128 is a divisor of 2128)

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 2128 (i.e. 46.130250378683). 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 )

  • 2128 / 1 = 2128 (the remainder is 0, so 1 and 2128 are divisors of 2128)
  • 2128 / 2 = 1064 (the remainder is 0, so 2 and 1064 are divisors of 2128)
  • 2128 / 3 = 709.33333333333 (the remainder is 1, so 3 is not a divisor of 2128)
  • ...
  • 2128 / 45 = 47.288888888889 (the remainder is 13, so 45 is not a divisor of 2128)
  • 2128 / 46 = 46.260869565217 (the remainder is 12, so 46 is not a divisor of 2128)