What are the divisors of 6102?

1, 2, 3, 6, 9, 18, 27, 54, 113, 226, 339, 678, 1017, 2034, 3051, 6102

8 even divisors

2, 6, 18, 54, 226, 678, 2034, 6102

8 odd divisors

1, 3, 9, 27, 113, 339, 1017, 3051

How to compute the divisors of 6102?

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

  • 6102 / 1 = 6102 (the remainder is 0, so 1 is a divisor of 6102)
  • 6102 / 2 = 3051 (the remainder is 0, so 2 is a divisor of 6102)
  • 6102 / 3 = 2034 (the remainder is 0, so 3 is a divisor of 6102)
  • ...
  • 6102 / 6101 = 1.0001639075561 (the remainder is 1, so 6101 is not a divisor of 6102)
  • 6102 / 6102 = 1 (the remainder is 0, so 6102 is a divisor of 6102)

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 6102 (i.e. 78.115299397749). 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 )

  • 6102 / 1 = 6102 (the remainder is 0, so 1 and 6102 are divisors of 6102)
  • 6102 / 2 = 3051 (the remainder is 0, so 2 and 3051 are divisors of 6102)
  • 6102 / 3 = 2034 (the remainder is 0, so 3 and 2034 are divisors of 6102)
  • ...
  • 6102 / 77 = 79.246753246753 (the remainder is 19, so 77 is not a divisor of 6102)
  • 6102 / 78 = 78.230769230769 (the remainder is 18, so 78 is not a divisor of 6102)