What are the divisors of 3066?

1, 2, 3, 6, 7, 14, 21, 42, 73, 146, 219, 438, 511, 1022, 1533, 3066

8 even divisors

2, 6, 14, 42, 146, 438, 1022, 3066

8 odd divisors

1, 3, 7, 21, 73, 219, 511, 1533

How to compute the divisors of 3066?

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

  • 3066 / 1 = 3066 (the remainder is 0, so 1 is a divisor of 3066)
  • 3066 / 2 = 1533 (the remainder is 0, so 2 is a divisor of 3066)
  • 3066 / 3 = 1022 (the remainder is 0, so 3 is a divisor of 3066)
  • ...
  • 3066 / 3065 = 1.0003262642741 (the remainder is 1, so 3065 is not a divisor of 3066)
  • 3066 / 3066 = 1 (the remainder is 0, so 3066 is a divisor of 3066)

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 3066 (i.e. 55.371472799629). 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 )

  • 3066 / 1 = 3066 (the remainder is 0, so 1 and 3066 are divisors of 3066)
  • 3066 / 2 = 1533 (the remainder is 0, so 2 and 1533 are divisors of 3066)
  • 3066 / 3 = 1022 (the remainder is 0, so 3 and 1022 are divisors of 3066)
  • ...
  • 3066 / 54 = 56.777777777778 (the remainder is 42, so 54 is not a divisor of 3066)
  • 3066 / 55 = 55.745454545455 (the remainder is 41, so 55 is not a divisor of 3066)