What are the divisors of 6156?

1, 2, 3, 4, 6, 9, 12, 18, 19, 27, 36, 38, 54, 57, 76, 81, 108, 114, 162, 171, 228, 324, 342, 513, 684, 1026, 1539, 2052, 3078, 6156

20 even divisors

2, 4, 6, 12, 18, 36, 38, 54, 76, 108, 114, 162, 228, 324, 342, 684, 1026, 2052, 3078, 6156

10 odd divisors

1, 3, 9, 19, 27, 57, 81, 171, 513, 1539

How to compute the divisors of 6156?

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

  • 6156 / 1 = 6156 (the remainder is 0, so 1 is a divisor of 6156)
  • 6156 / 2 = 3078 (the remainder is 0, so 2 is a divisor of 6156)
  • 6156 / 3 = 2052 (the remainder is 0, so 3 is a divisor of 6156)
  • ...
  • 6156 / 6155 = 1.000162469537 (the remainder is 1, so 6155 is not a divisor of 6156)
  • 6156 / 6156 = 1 (the remainder is 0, so 6156 is a divisor of 6156)

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 6156 (i.e. 78.460180983732). 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 )

  • 6156 / 1 = 6156 (the remainder is 0, so 1 and 6156 are divisors of 6156)
  • 6156 / 2 = 3078 (the remainder is 0, so 2 and 3078 are divisors of 6156)
  • 6156 / 3 = 2052 (the remainder is 0, so 3 and 2052 are divisors of 6156)
  • ...
  • 6156 / 77 = 79.948051948052 (the remainder is 73, so 77 is not a divisor of 6156)
  • 6156 / 78 = 78.923076923077 (the remainder is 72, so 78 is not a divisor of 6156)