What are the divisors of 4996?

1, 2, 4, 1249, 2498, 4996

4 even divisors

2, 4, 2498, 4996

2 odd divisors

1, 1249

How to compute the divisors of 4996?

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

  • 4996 / 1 = 4996 (the remainder is 0, so 1 is a divisor of 4996)
  • 4996 / 2 = 2498 (the remainder is 0, so 2 is a divisor of 4996)
  • 4996 / 3 = 1665.3333333333 (the remainder is 1, so 3 is not a divisor of 4996)
  • ...
  • 4996 / 4995 = 1.0002002002002 (the remainder is 1, so 4995 is not a divisor of 4996)
  • 4996 / 4996 = 1 (the remainder is 0, so 4996 is a divisor of 4996)

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 4996 (i.e. 70.682388188289). 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 )

  • 4996 / 1 = 4996 (the remainder is 0, so 1 and 4996 are divisors of 4996)
  • 4996 / 2 = 2498 (the remainder is 0, so 2 and 2498 are divisors of 4996)
  • 4996 / 3 = 1665.3333333333 (the remainder is 1, so 3 is not a divisor of 4996)
  • ...
  • 4996 / 69 = 72.405797101449 (the remainder is 28, so 69 is not a divisor of 4996)
  • 4996 / 70 = 71.371428571429 (the remainder is 26, so 70 is not a divisor of 4996)