What are the divisors of 3078?

1, 2, 3, 6, 9, 18, 19, 27, 38, 54, 57, 81, 114, 162, 171, 342, 513, 1026, 1539, 3078

10 even divisors

2, 6, 18, 38, 54, 114, 162, 342, 1026, 3078

10 odd divisors

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

How to compute the divisors of 3078?

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

  • 3078 / 1 = 3078 (the remainder is 0, so 1 is a divisor of 3078)
  • 3078 / 2 = 1539 (the remainder is 0, so 2 is a divisor of 3078)
  • 3078 / 3 = 1026 (the remainder is 0, so 3 is a divisor of 3078)
  • ...
  • 3078 / 3077 = 1.0003249918752 (the remainder is 1, so 3077 is not a divisor of 3078)
  • 3078 / 3078 = 1 (the remainder is 0, so 3078 is a divisor of 3078)

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 3078 (i.e. 55.479726026721). 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 )

  • 3078 / 1 = 3078 (the remainder is 0, so 1 and 3078 are divisors of 3078)
  • 3078 / 2 = 1539 (the remainder is 0, so 2 and 1539 are divisors of 3078)
  • 3078 / 3 = 1026 (the remainder is 0, so 3 and 1026 are divisors of 3078)
  • ...
  • 3078 / 54 = 57 (the remainder is 0, so 54 and 57 are divisors of 3078)
  • 3078 / 55 = 55.963636363636 (the remainder is 53, so 55 is not a divisor of 3078)