What are the divisors of 2782?

1, 2, 13, 26, 107, 214, 1391, 2782

4 even divisors

2, 26, 214, 2782

4 odd divisors

1, 13, 107, 1391

How to compute the divisors of 2782?

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

  • 2782 / 1 = 2782 (the remainder is 0, so 1 is a divisor of 2782)
  • 2782 / 2 = 1391 (the remainder is 0, so 2 is a divisor of 2782)
  • 2782 / 3 = 927.33333333333 (the remainder is 1, so 3 is not a divisor of 2782)
  • ...
  • 2782 / 2781 = 1.0003595828839 (the remainder is 1, so 2781 is not a divisor of 2782)
  • 2782 / 2782 = 1 (the remainder is 0, so 2782 is a divisor of 2782)

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 2782 (i.e. 52.744667976962). 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 )

  • 2782 / 1 = 2782 (the remainder is 0, so 1 and 2782 are divisors of 2782)
  • 2782 / 2 = 1391 (the remainder is 0, so 2 and 1391 are divisors of 2782)
  • 2782 / 3 = 927.33333333333 (the remainder is 1, so 3 is not a divisor of 2782)
  • ...
  • 2782 / 51 = 54.549019607843 (the remainder is 28, so 51 is not a divisor of 2782)
  • 2782 / 52 = 53.5 (the remainder is 26, so 52 is not a divisor of 2782)