What are the divisors of 1014?

1, 2, 3, 6, 13, 26, 39, 78, 169, 338, 507, 1014

6 even divisors

2, 6, 26, 78, 338, 1014

6 odd divisors

1, 3, 13, 39, 169, 507

How to compute the divisors of 1014?

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

  • 1014 / 1 = 1014 (the remainder is 0, so 1 is a divisor of 1014)
  • 1014 / 2 = 507 (the remainder is 0, so 2 is a divisor of 1014)
  • 1014 / 3 = 338 (the remainder is 0, so 3 is a divisor of 1014)
  • ...
  • 1014 / 1013 = 1.0009871668312 (the remainder is 1, so 1013 is not a divisor of 1014)
  • 1014 / 1014 = 1 (the remainder is 0, so 1014 is a divisor of 1014)

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 1014 (i.e. 31.843366656181). 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 )

  • 1014 / 1 = 1014 (the remainder is 0, so 1 and 1014 are divisors of 1014)
  • 1014 / 2 = 507 (the remainder is 0, so 2 and 507 are divisors of 1014)
  • 1014 / 3 = 338 (the remainder is 0, so 3 and 338 are divisors of 1014)
  • ...
  • 1014 / 30 = 33.8 (the remainder is 24, so 30 is not a divisor of 1014)
  • 1014 / 31 = 32.709677419355 (the remainder is 22, so 31 is not a divisor of 1014)