What are the divisors of 4995?

1, 3, 5, 9, 15, 27, 37, 45, 111, 135, 185, 333, 555, 999, 1665, 4995

16 odd divisors

1, 3, 5, 9, 15, 27, 37, 45, 111, 135, 185, 333, 555, 999, 1665, 4995

How to compute the divisors of 4995?

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

  • 4995 / 1 = 4995 (the remainder is 0, so 1 is a divisor of 4995)
  • 4995 / 2 = 2497.5 (the remainder is 1, so 2 is not a divisor of 4995)
  • 4995 / 3 = 1665 (the remainder is 0, so 3 is a divisor of 4995)
  • ...
  • 4995 / 4994 = 1.0002002402883 (the remainder is 1, so 4994 is not a divisor of 4995)
  • 4995 / 4995 = 1 (the remainder is 0, so 4995 is a divisor of 4995)

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 4995 (i.e. 70.675313936338). 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 )

  • 4995 / 1 = 4995 (the remainder is 0, so 1 and 4995 are divisors of 4995)
  • 4995 / 2 = 2497.5 (the remainder is 1, so 2 is not a divisor of 4995)
  • 4995 / 3 = 1665 (the remainder is 0, so 3 and 1665 are divisors of 4995)
  • ...
  • 4995 / 69 = 72.391304347826 (the remainder is 27, so 69 is not a divisor of 4995)
  • 4995 / 70 = 71.357142857143 (the remainder is 25, so 70 is not a divisor of 4995)