What are the divisors of 3213?

1, 3, 7, 9, 17, 21, 27, 51, 63, 119, 153, 189, 357, 459, 1071, 3213

16 odd divisors

1, 3, 7, 9, 17, 21, 27, 51, 63, 119, 153, 189, 357, 459, 1071, 3213

How to compute the divisors of 3213?

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

  • 3213 / 1 = 3213 (the remainder is 0, so 1 is a divisor of 3213)
  • 3213 / 2 = 1606.5 (the remainder is 1, so 2 is not a divisor of 3213)
  • 3213 / 3 = 1071 (the remainder is 0, so 3 is a divisor of 3213)
  • ...
  • 3213 / 3212 = 1.0003113325031 (the remainder is 1, so 3212 is not a divisor of 3213)
  • 3213 / 3213 = 1 (the remainder is 0, so 3213 is a divisor of 3213)

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 3213 (i.e. 56.683330883074). 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 )

  • 3213 / 1 = 3213 (the remainder is 0, so 1 and 3213 are divisors of 3213)
  • 3213 / 2 = 1606.5 (the remainder is 1, so 2 is not a divisor of 3213)
  • 3213 / 3 = 1071 (the remainder is 0, so 3 and 1071 are divisors of 3213)
  • ...
  • 3213 / 55 = 58.418181818182 (the remainder is 23, so 55 is not a divisor of 3213)
  • 3213 / 56 = 57.375 (the remainder is 21, so 56 is not a divisor of 3213)