What are the divisors of 2130?

1, 2, 3, 5, 6, 10, 15, 30, 71, 142, 213, 355, 426, 710, 1065, 2130

8 even divisors

2, 6, 10, 30, 142, 426, 710, 2130

8 odd divisors

1, 3, 5, 15, 71, 213, 355, 1065

How to compute the divisors of 2130?

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

  • 2130 / 1 = 2130 (the remainder is 0, so 1 is a divisor of 2130)
  • 2130 / 2 = 1065 (the remainder is 0, so 2 is a divisor of 2130)
  • 2130 / 3 = 710 (the remainder is 0, so 3 is a divisor of 2130)
  • ...
  • 2130 / 2129 = 1.0004697040864 (the remainder is 1, so 2129 is not a divisor of 2130)
  • 2130 / 2130 = 1 (the remainder is 0, so 2130 is a divisor of 2130)

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 2130 (i.e. 46.151923036857). 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 )

  • 2130 / 1 = 2130 (the remainder is 0, so 1 and 2130 are divisors of 2130)
  • 2130 / 2 = 1065 (the remainder is 0, so 2 and 1065 are divisors of 2130)
  • 2130 / 3 = 710 (the remainder is 0, so 3 and 710 are divisors of 2130)
  • ...
  • 2130 / 45 = 47.333333333333 (the remainder is 15, so 45 is not a divisor of 2130)
  • 2130 / 46 = 46.304347826087 (the remainder is 14, so 46 is not a divisor of 2130)