What are the divisors of 8216?

1, 2, 4, 8, 13, 26, 52, 79, 104, 158, 316, 632, 1027, 2054, 4108, 8216

12 even divisors

2, 4, 8, 26, 52, 104, 158, 316, 632, 2054, 4108, 8216

4 odd divisors

1, 13, 79, 1027

How to compute the divisors of 8216?

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

  • 8216 / 1 = 8216 (the remainder is 0, so 1 is a divisor of 8216)
  • 8216 / 2 = 4108 (the remainder is 0, so 2 is a divisor of 8216)
  • 8216 / 3 = 2738.6666666667 (the remainder is 2, so 3 is not a divisor of 8216)
  • ...
  • 8216 / 8215 = 1.0001217285453 (the remainder is 1, so 8215 is not a divisor of 8216)
  • 8216 / 8216 = 1 (the remainder is 0, so 8216 is a divisor of 8216)

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 8216 (i.e. 90.642153548997). 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 )

  • 8216 / 1 = 8216 (the remainder is 0, so 1 and 8216 are divisors of 8216)
  • 8216 / 2 = 4108 (the remainder is 0, so 2 and 4108 are divisors of 8216)
  • 8216 / 3 = 2738.6666666667 (the remainder is 2, so 3 is not a divisor of 8216)
  • ...
  • 8216 / 89 = 92.314606741573 (the remainder is 28, so 89 is not a divisor of 8216)
  • 8216 / 90 = 91.288888888889 (the remainder is 26, so 90 is not a divisor of 8216)