What are the divisors of 4780?

1, 2, 4, 5, 10, 20, 239, 478, 956, 1195, 2390, 4780

8 even divisors

2, 4, 10, 20, 478, 956, 2390, 4780

4 odd divisors

1, 5, 239, 1195

How to compute the divisors of 4780?

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

  • 4780 / 1 = 4780 (the remainder is 0, so 1 is a divisor of 4780)
  • 4780 / 2 = 2390 (the remainder is 0, so 2 is a divisor of 4780)
  • 4780 / 3 = 1593.3333333333 (the remainder is 1, so 3 is not a divisor of 4780)
  • ...
  • 4780 / 4779 = 1.0002092487968 (the remainder is 1, so 4779 is not a divisor of 4780)
  • 4780 / 4780 = 1 (the remainder is 0, so 4780 is a divisor of 4780)

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 4780 (i.e. 69.137544069774). 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 )

  • 4780 / 1 = 4780 (the remainder is 0, so 1 and 4780 are divisors of 4780)
  • 4780 / 2 = 2390 (the remainder is 0, so 2 and 2390 are divisors of 4780)
  • 4780 / 3 = 1593.3333333333 (the remainder is 1, so 3 is not a divisor of 4780)
  • ...
  • 4780 / 68 = 70.294117647059 (the remainder is 20, so 68 is not a divisor of 4780)
  • 4780 / 69 = 69.275362318841 (the remainder is 19, so 69 is not a divisor of 4780)