What are the divisors of 3246?

1, 2, 3, 6, 541, 1082, 1623, 3246

4 even divisors

2, 6, 1082, 3246

4 odd divisors

1, 3, 541, 1623

How to compute the divisors of 3246?

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

  • 3246 / 1 = 3246 (the remainder is 0, so 1 is a divisor of 3246)
  • 3246 / 2 = 1623 (the remainder is 0, so 2 is a divisor of 3246)
  • 3246 / 3 = 1082 (the remainder is 0, so 3 is a divisor of 3246)
  • ...
  • 3246 / 3245 = 1.0003081664099 (the remainder is 1, so 3245 is not a divisor of 3246)
  • 3246 / 3246 = 1 (the remainder is 0, so 3246 is a divisor of 3246)

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 3246 (i.e. 56.973678132976). 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 )

  • 3246 / 1 = 3246 (the remainder is 0, so 1 and 3246 are divisors of 3246)
  • 3246 / 2 = 1623 (the remainder is 0, so 2 and 1623 are divisors of 3246)
  • 3246 / 3 = 1082 (the remainder is 0, so 3 and 1082 are divisors of 3246)
  • ...
  • 3246 / 55 = 59.018181818182 (the remainder is 1, so 55 is not a divisor of 3246)
  • 3246 / 56 = 57.964285714286 (the remainder is 54, so 56 is not a divisor of 3246)