What are the divisors of 3114?

1, 2, 3, 6, 9, 18, 173, 346, 519, 1038, 1557, 3114

6 even divisors

2, 6, 18, 346, 1038, 3114

6 odd divisors

1, 3, 9, 173, 519, 1557

How to compute the divisors of 3114?

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

  • 3114 / 1 = 3114 (the remainder is 0, so 1 is a divisor of 3114)
  • 3114 / 2 = 1557 (the remainder is 0, so 2 is a divisor of 3114)
  • 3114 / 3 = 1038 (the remainder is 0, so 3 is a divisor of 3114)
  • ...
  • 3114 / 3113 = 1.0003212335368 (the remainder is 1, so 3113 is not a divisor of 3114)
  • 3114 / 3114 = 1 (the remainder is 0, so 3114 is a divisor of 3114)

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 3114 (i.e. 55.803225713215). 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 )

  • 3114 / 1 = 3114 (the remainder is 0, so 1 and 3114 are divisors of 3114)
  • 3114 / 2 = 1557 (the remainder is 0, so 2 and 1557 are divisors of 3114)
  • 3114 / 3 = 1038 (the remainder is 0, so 3 and 1038 are divisors of 3114)
  • ...
  • 3114 / 54 = 57.666666666667 (the remainder is 36, so 54 is not a divisor of 3114)
  • 3114 / 55 = 56.618181818182 (the remainder is 34, so 55 is not a divisor of 3114)