What are the divisors of 2145?

1, 3, 5, 11, 13, 15, 33, 39, 55, 65, 143, 165, 195, 429, 715, 2145

16 odd divisors

1, 3, 5, 11, 13, 15, 33, 39, 55, 65, 143, 165, 195, 429, 715, 2145

How to compute the divisors of 2145?

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

  • 2145 / 1 = 2145 (the remainder is 0, so 1 is a divisor of 2145)
  • 2145 / 2 = 1072.5 (the remainder is 1, so 2 is not a divisor of 2145)
  • 2145 / 3 = 715 (the remainder is 0, so 3 is a divisor of 2145)
  • ...
  • 2145 / 2144 = 1.0004664179104 (the remainder is 1, so 2144 is not a divisor of 2145)
  • 2145 / 2145 = 1 (the remainder is 0, so 2145 is a divisor of 2145)

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 2145 (i.e. 46.314144707638). 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 )

  • 2145 / 1 = 2145 (the remainder is 0, so 1 and 2145 are divisors of 2145)
  • 2145 / 2 = 1072.5 (the remainder is 1, so 2 is not a divisor of 2145)
  • 2145 / 3 = 715 (the remainder is 0, so 3 and 715 are divisors of 2145)
  • ...
  • 2145 / 45 = 47.666666666667 (the remainder is 30, so 45 is not a divisor of 2145)
  • 2145 / 46 = 46.630434782609 (the remainder is 29, so 46 is not a divisor of 2145)