What are the divisors of 23?

1, 23

2 odd divisors

1, 23

How to compute the divisors of 23?

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

  • 23 / 1 = 23 (the remainder is 0, so 1 is a divisor of 23)
  • 23 / 2 = 11.5 (the remainder is 1, so 2 is not a divisor of 23)
  • 23 / 3 = 7.6666666666667 (the remainder is 2, so 3 is not a divisor of 23)
  • ...
  • 23 / 4 = 5.75 (the remainder is 3, so 4 is not a divisor of 23)
  • 23 / 5 = 4.6 (the remainder is 3, so 5 is not a divisor of 23)
  • 23 / 6 = 3.8333333333333 (the remainder is 5, so 6 is not a divisor of 23)
  • 23 / 7 = 3.2857142857143 (the remainder is 2, so 7 is not a divisor of 23)
  • 23 / 8 = 2.875 (the remainder is 7, so 8 is not a divisor of 23)
  • 23 / 9 = 2.5555555555556 (the remainder is 5, so 9 is not a divisor of 23)
  • 23 / 10 = 2.3 (the remainder is 3, so 10 is not a divisor of 23)
  • 23 / 11 = 2.0909090909091 (the remainder is 1, so 11 is not a divisor of 23)
  • 23 / 12 = 1.9166666666667 (the remainder is 11, so 12 is not a divisor of 23)
  • 23 / 13 = 1.7692307692308 (the remainder is 10, so 13 is not a divisor of 23)
  • 23 / 14 = 1.6428571428571 (the remainder is 9, so 14 is not a divisor of 23)
  • 23 / 15 = 1.5333333333333 (the remainder is 8, so 15 is not a divisor of 23)
  • 23 / 16 = 1.4375 (the remainder is 7, so 16 is not a divisor of 23)
  • 23 / 17 = 1.3529411764706 (the remainder is 6, so 17 is not a divisor of 23)
  • 23 / 18 = 1.2777777777778 (the remainder is 5, so 18 is not a divisor of 23)
  • 23 / 19 = 1.2105263157895 (the remainder is 4, so 19 is not a divisor of 23)
  • 23 / 20 = 1.15 (the remainder is 3, so 20 is not a divisor of 23)
  • 23 / 21 = 1.0952380952381 (the remainder is 2, so 21 is not a divisor of 23)
  • 23 / 22 = 1.0454545454545 (the remainder is 1, so 22 is not a divisor of 23)
  • 23 / 23 = 1 (the remainder is 0, so 23 is a divisor of 23)

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 23 (i.e. 4.7958315233127). 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 )

  • 23 / 1 = 23 (the remainder is 0, so 1 and 23 are divisors of 23)
  • 23 / 2 = 11.5 (the remainder is 1, so 2 is not a divisor of 23)
  • 23 / 3 = 7.6666666666667 (the remainder is 2, so 3 is not a divisor of 23)
  • ...
  • 23 / 4 = 5.75 (the remainder is 3, so 4 is not a divisor of 23)