What are the divisors of 8064?

1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 16, 18, 21, 24, 28, 32, 36, 42, 48, 56, 63, 64, 72, 84, 96, 112, 126, 128, 144, 168, 192, 224, 252, 288, 336, 384, 448, 504, 576, 672, 896, 1008, 1152, 1344, 2016, 2688, 4032, 8064

42 even divisors

2, 4, 6, 8, 12, 14, 16, 18, 24, 28, 32, 36, 42, 48, 56, 64, 72, 84, 96, 112, 126, 128, 144, 168, 192, 224, 252, 288, 336, 384, 448, 504, 576, 672, 896, 1008, 1152, 1344, 2016, 2688, 4032, 8064

6 odd divisors

1, 3, 7, 9, 21, 63

How to compute the divisors of 8064?

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

  • 8064 / 1 = 8064 (the remainder is 0, so 1 is a divisor of 8064)
  • 8064 / 2 = 4032 (the remainder is 0, so 2 is a divisor of 8064)
  • 8064 / 3 = 2688 (the remainder is 0, so 3 is a divisor of 8064)
  • ...
  • 8064 / 8063 = 1.0001240233164 (the remainder is 1, so 8063 is not a divisor of 8064)
  • 8064 / 8064 = 1 (the remainder is 0, so 8064 is a divisor of 8064)

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 8064 (i.e. 89.799777282575). 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 )

  • 8064 / 1 = 8064 (the remainder is 0, so 1 and 8064 are divisors of 8064)
  • 8064 / 2 = 4032 (the remainder is 0, so 2 and 4032 are divisors of 8064)
  • 8064 / 3 = 2688 (the remainder is 0, so 3 and 2688 are divisors of 8064)
  • ...
  • 8064 / 88 = 91.636363636364 (the remainder is 56, so 88 is not a divisor of 8064)
  • 8064 / 89 = 90.606741573034 (the remainder is 54, so 89 is not a divisor of 8064)