What are the divisors of 648?

1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 27, 36, 54, 72, 81, 108, 162, 216, 324, 648

15 even divisors

2, 4, 6, 8, 12, 18, 24, 36, 54, 72, 108, 162, 216, 324, 648

5 odd divisors

1, 3, 9, 27, 81

How to compute the divisors of 648?

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

  • 648 / 1 = 648 (the remainder is 0, so 1 is a divisor of 648)
  • 648 / 2 = 324 (the remainder is 0, so 2 is a divisor of 648)
  • 648 / 3 = 216 (the remainder is 0, so 3 is a divisor of 648)
  • ...
  • 648 / 647 = 1.0015455950541 (the remainder is 1, so 647 is not a divisor of 648)
  • 648 / 648 = 1 (the remainder is 0, so 648 is a divisor of 648)

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 648 (i.e. 25.455844122716). 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 )

  • 648 / 1 = 648 (the remainder is 0, so 1 and 648 are divisors of 648)
  • 648 / 2 = 324 (the remainder is 0, so 2 and 324 are divisors of 648)
  • 648 / 3 = 216 (the remainder is 0, so 3 and 216 are divisors of 648)
  • ...
  • 648 / 24 = 27 (the remainder is 0, so 24 and 27 are divisors of 648)
  • 648 / 25 = 25.92 (the remainder is 23, so 25 is not a divisor of 648)