What are the divisors of 19?

1, 19

2 odd divisors

1, 19

How to compute the divisors of 19?

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

  • 19 / 1 = 19 (the remainder is 0, so 1 is a divisor of 19)
  • 19 / 2 = 9.5 (the remainder is 1, so 2 is not a divisor of 19)
  • 19 / 3 = 6.3333333333333 (the remainder is 1, so 3 is not a divisor of 19)
  • ...
  • 19 / 4 = 4.75 (the remainder is 3, so 4 is not a divisor of 19)
  • 19 / 5 = 3.8 (the remainder is 4, so 5 is not a divisor of 19)
  • 19 / 6 = 3.1666666666667 (the remainder is 1, so 6 is not a divisor of 19)
  • 19 / 7 = 2.7142857142857 (the remainder is 5, so 7 is not a divisor of 19)
  • 19 / 8 = 2.375 (the remainder is 3, so 8 is not a divisor of 19)
  • 19 / 9 = 2.1111111111111 (the remainder is 1, so 9 is not a divisor of 19)
  • 19 / 10 = 1.9 (the remainder is 9, so 10 is not a divisor of 19)
  • 19 / 11 = 1.7272727272727 (the remainder is 8, so 11 is not a divisor of 19)
  • 19 / 12 = 1.5833333333333 (the remainder is 7, so 12 is not a divisor of 19)
  • 19 / 13 = 1.4615384615385 (the remainder is 6, so 13 is not a divisor of 19)
  • 19 / 14 = 1.3571428571429 (the remainder is 5, so 14 is not a divisor of 19)
  • 19 / 15 = 1.2666666666667 (the remainder is 4, so 15 is not a divisor of 19)
  • 19 / 16 = 1.1875 (the remainder is 3, so 16 is not a divisor of 19)
  • 19 / 17 = 1.1176470588235 (the remainder is 2, so 17 is not a divisor of 19)
  • 19 / 18 = 1.0555555555556 (the remainder is 1, so 18 is not a divisor of 19)
  • 19 / 19 = 1 (the remainder is 0, so 19 is a divisor of 19)

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 19 (i.e. 4.3588989435407). 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 )

  • 19 / 1 = 19 (the remainder is 0, so 1 and 19 are divisors of 19)
  • 19 / 2 = 9.5 (the remainder is 1, so 2 is not a divisor of 19)
  • 19 / 3 = 6.3333333333333 (the remainder is 1, so 3 is not a divisor of 19)
  • ...
  • 19 / 4 = 4.75 (the remainder is 3, so 4 is not a divisor of 19)