What are the divisors of 4797?

1, 3, 9, 13, 39, 41, 117, 123, 369, 533, 1599, 4797

12 odd divisors

1, 3, 9, 13, 39, 41, 117, 123, 369, 533, 1599, 4797

How to compute the divisors of 4797?

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

  • 4797 / 1 = 4797 (the remainder is 0, so 1 is a divisor of 4797)
  • 4797 / 2 = 2398.5 (the remainder is 1, so 2 is not a divisor of 4797)
  • 4797 / 3 = 1599 (the remainder is 0, so 3 is a divisor of 4797)
  • ...
  • 4797 / 4796 = 1.0002085070892 (the remainder is 1, so 4796 is not a divisor of 4797)
  • 4797 / 4797 = 1 (the remainder is 0, so 4797 is a divisor of 4797)

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 4797 (i.e. 69.260378283691). 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 )

  • 4797 / 1 = 4797 (the remainder is 0, so 1 and 4797 are divisors of 4797)
  • 4797 / 2 = 2398.5 (the remainder is 1, so 2 is not a divisor of 4797)
  • 4797 / 3 = 1599 (the remainder is 0, so 3 and 1599 are divisors of 4797)
  • ...
  • 4797 / 68 = 70.544117647059 (the remainder is 37, so 68 is not a divisor of 4797)
  • 4797 / 69 = 69.521739130435 (the remainder is 36, so 69 is not a divisor of 4797)