What are the divisors of 2838?

1, 2, 3, 6, 11, 22, 33, 43, 66, 86, 129, 258, 473, 946, 1419, 2838

8 even divisors

2, 6, 22, 66, 86, 258, 946, 2838

8 odd divisors

1, 3, 11, 33, 43, 129, 473, 1419

How to compute the divisors of 2838?

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

  • 2838 / 1 = 2838 (the remainder is 0, so 1 is a divisor of 2838)
  • 2838 / 2 = 1419 (the remainder is 0, so 2 is a divisor of 2838)
  • 2838 / 3 = 946 (the remainder is 0, so 3 is a divisor of 2838)
  • ...
  • 2838 / 2837 = 1.0003524850194 (the remainder is 1, so 2837 is not a divisor of 2838)
  • 2838 / 2838 = 1 (the remainder is 0, so 2838 is a divisor of 2838)

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 2838 (i.e. 53.272882407469). 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 )

  • 2838 / 1 = 2838 (the remainder is 0, so 1 and 2838 are divisors of 2838)
  • 2838 / 2 = 1419 (the remainder is 0, so 2 and 1419 are divisors of 2838)
  • 2838 / 3 = 946 (the remainder is 0, so 3 and 946 are divisors of 2838)
  • ...
  • 2838 / 52 = 54.576923076923 (the remainder is 30, so 52 is not a divisor of 2838)
  • 2838 / 53 = 53.547169811321 (the remainder is 29, so 53 is not a divisor of 2838)