What are the divisors of 780?

1, 2, 3, 4, 5, 6, 10, 12, 13, 15, 20, 26, 30, 39, 52, 60, 65, 78, 130, 156, 195, 260, 390, 780

16 even divisors

2, 4, 6, 10, 12, 20, 26, 30, 52, 60, 78, 130, 156, 260, 390, 780

8 odd divisors

1, 3, 5, 13, 15, 39, 65, 195

How to compute the divisors of 780?

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

  • 780 / 1 = 780 (the remainder is 0, so 1 is a divisor of 780)
  • 780 / 2 = 390 (the remainder is 0, so 2 is a divisor of 780)
  • 780 / 3 = 260 (the remainder is 0, so 3 is a divisor of 780)
  • ...
  • 780 / 779 = 1.0012836970475 (the remainder is 1, so 779 is not a divisor of 780)
  • 780 / 780 = 1 (the remainder is 0, so 780 is a divisor of 780)

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 780 (i.e. 27.928480087538). 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 )

  • 780 / 1 = 780 (the remainder is 0, so 1 and 780 are divisors of 780)
  • 780 / 2 = 390 (the remainder is 0, so 2 and 390 are divisors of 780)
  • 780 / 3 = 260 (the remainder is 0, so 3 and 260 are divisors of 780)
  • ...
  • 780 / 26 = 30 (the remainder is 0, so 26 and 30 are divisors of 780)
  • 780 / 27 = 28.888888888889 (the remainder is 24, so 27 is not a divisor of 780)