What are the divisors of 3054?

1, 2, 3, 6, 509, 1018, 1527, 3054

4 even divisors

2, 6, 1018, 3054

4 odd divisors

1, 3, 509, 1527

How to compute the divisors of 3054?

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

  • 3054 / 1 = 3054 (the remainder is 0, so 1 is a divisor of 3054)
  • 3054 / 2 = 1527 (the remainder is 0, so 2 is a divisor of 3054)
  • 3054 / 3 = 1018 (the remainder is 0, so 3 is a divisor of 3054)
  • ...
  • 3054 / 3053 = 1.0003275466754 (the remainder is 1, so 3053 is not a divisor of 3054)
  • 3054 / 3054 = 1 (the remainder is 0, so 3054 is a divisor of 3054)

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 3054 (i.e. 55.263007518592). 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 )

  • 3054 / 1 = 3054 (the remainder is 0, so 1 and 3054 are divisors of 3054)
  • 3054 / 2 = 1527 (the remainder is 0, so 2 and 1527 are divisors of 3054)
  • 3054 / 3 = 1018 (the remainder is 0, so 3 and 1018 are divisors of 3054)
  • ...
  • 3054 / 54 = 56.555555555556 (the remainder is 30, so 54 is not a divisor of 3054)
  • 3054 / 55 = 55.527272727273 (the remainder is 29, so 55 is not a divisor of 3054)