What are the divisors of 2790?

1, 2, 3, 5, 6, 9, 10, 15, 18, 30, 31, 45, 62, 90, 93, 155, 186, 279, 310, 465, 558, 930, 1395, 2790

12 even divisors

2, 6, 10, 18, 30, 62, 90, 186, 310, 558, 930, 2790

12 odd divisors

1, 3, 5, 9, 15, 31, 45, 93, 155, 279, 465, 1395

How to compute the divisors of 2790?

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

  • 2790 / 1 = 2790 (the remainder is 0, so 1 is a divisor of 2790)
  • 2790 / 2 = 1395 (the remainder is 0, so 2 is a divisor of 2790)
  • 2790 / 3 = 930 (the remainder is 0, so 3 is a divisor of 2790)
  • ...
  • 2790 / 2789 = 1.0003585514521 (the remainder is 1, so 2789 is not a divisor of 2790)
  • 2790 / 2790 = 1 (the remainder is 0, so 2790 is a divisor of 2790)

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 2790 (i.e. 52.820450584977). 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 )

  • 2790 / 1 = 2790 (the remainder is 0, so 1 and 2790 are divisors of 2790)
  • 2790 / 2 = 1395 (the remainder is 0, so 2 and 1395 are divisors of 2790)
  • 2790 / 3 = 930 (the remainder is 0, so 3 and 930 are divisors of 2790)
  • ...
  • 2790 / 51 = 54.705882352941 (the remainder is 36, so 51 is not a divisor of 2790)
  • 2790 / 52 = 53.653846153846 (the remainder is 34, so 52 is not a divisor of 2790)