What are the divisors of 720?

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 30, 36, 40, 45, 48, 60, 72, 80, 90, 120, 144, 180, 240, 360, 720

24 even divisors

2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 30, 36, 40, 48, 60, 72, 80, 90, 120, 144, 180, 240, 360, 720

6 odd divisors

1, 3, 5, 9, 15, 45

How to compute the divisors of 720?

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

  • 720 / 1 = 720 (the remainder is 0, so 1 is a divisor of 720)
  • 720 / 2 = 360 (the remainder is 0, so 2 is a divisor of 720)
  • 720 / 3 = 240 (the remainder is 0, so 3 is a divisor of 720)
  • ...
  • 720 / 719 = 1.0013908205841 (the remainder is 1, so 719 is not a divisor of 720)
  • 720 / 720 = 1 (the remainder is 0, so 720 is a divisor of 720)

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 720 (i.e. 26.832815729997). 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 )

  • 720 / 1 = 720 (the remainder is 0, so 1 and 720 are divisors of 720)
  • 720 / 2 = 360 (the remainder is 0, so 2 and 360 are divisors of 720)
  • 720 / 3 = 240 (the remainder is 0, so 3 and 240 are divisors of 720)
  • ...
  • 720 / 25 = 28.8 (the remainder is 20, so 25 is not a divisor of 720)
  • 720 / 26 = 27.692307692308 (the remainder is 18, so 26 is not a divisor of 720)