What are the divisors of 9164?

1, 2, 4, 29, 58, 79, 116, 158, 316, 2291, 4582, 9164

8 even divisors

2, 4, 58, 116, 158, 316, 4582, 9164

4 odd divisors

1, 29, 79, 2291

How to compute the divisors of 9164?

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

  • 9164 / 1 = 9164 (the remainder is 0, so 1 is a divisor of 9164)
  • 9164 / 2 = 4582 (the remainder is 0, so 2 is a divisor of 9164)
  • 9164 / 3 = 3054.6666666667 (the remainder is 2, so 3 is not a divisor of 9164)
  • ...
  • 9164 / 9163 = 1.0001091345629 (the remainder is 1, so 9163 is not a divisor of 9164)
  • 9164 / 9164 = 1 (the remainder is 0, so 9164 is a divisor of 9164)

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 9164 (i.e. 95.728783550195). 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 )

  • 9164 / 1 = 9164 (the remainder is 0, so 1 and 9164 are divisors of 9164)
  • 9164 / 2 = 4582 (the remainder is 0, so 2 and 4582 are divisors of 9164)
  • 9164 / 3 = 3054.6666666667 (the remainder is 2, so 3 is not a divisor of 9164)
  • ...
  • 9164 / 94 = 97.489361702128 (the remainder is 46, so 94 is not a divisor of 9164)
  • 9164 / 95 = 96.463157894737 (the remainder is 44, so 95 is not a divisor of 9164)