What are the divisors of 9156?

1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84, 109, 218, 327, 436, 654, 763, 1308, 1526, 2289, 3052, 4578, 9156

16 even divisors

2, 4, 6, 12, 14, 28, 42, 84, 218, 436, 654, 1308, 1526, 3052, 4578, 9156

8 odd divisors

1, 3, 7, 21, 109, 327, 763, 2289

How to compute the divisors of 9156?

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

  • 9156 / 1 = 9156 (the remainder is 0, so 1 is a divisor of 9156)
  • 9156 / 2 = 4578 (the remainder is 0, so 2 is a divisor of 9156)
  • 9156 / 3 = 3052 (the remainder is 0, so 3 is a divisor of 9156)
  • ...
  • 9156 / 9155 = 1.000109229929 (the remainder is 1, so 9155 is not a divisor of 9156)
  • 9156 / 9156 = 1 (the remainder is 0, so 9156 is a divisor of 9156)

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 9156 (i.e. 95.686989711245). 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 )

  • 9156 / 1 = 9156 (the remainder is 0, so 1 and 9156 are divisors of 9156)
  • 9156 / 2 = 4578 (the remainder is 0, so 2 and 4578 are divisors of 9156)
  • 9156 / 3 = 3052 (the remainder is 0, so 3 and 3052 are divisors of 9156)
  • ...
  • 9156 / 94 = 97.404255319149 (the remainder is 38, so 94 is not a divisor of 9156)
  • 9156 / 95 = 96.378947368421 (the remainder is 36, so 95 is not a divisor of 9156)