What are the divisors of 4978?

1, 2, 19, 38, 131, 262, 2489, 4978

4 even divisors

2, 38, 262, 4978

4 odd divisors

1, 19, 131, 2489

How to compute the divisors of 4978?

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

  • 4978 / 1 = 4978 (the remainder is 0, so 1 is a divisor of 4978)
  • 4978 / 2 = 2489 (the remainder is 0, so 2 is a divisor of 4978)
  • 4978 / 3 = 1659.3333333333 (the remainder is 1, so 3 is not a divisor of 4978)
  • ...
  • 4978 / 4977 = 1.0002009242516 (the remainder is 1, so 4977 is not a divisor of 4978)
  • 4978 / 4978 = 1 (the remainder is 0, so 4978 is a divisor of 4978)

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 4978 (i.e. 70.554943129451). 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 )

  • 4978 / 1 = 4978 (the remainder is 0, so 1 and 4978 are divisors of 4978)
  • 4978 / 2 = 2489 (the remainder is 0, so 2 and 2489 are divisors of 4978)
  • 4978 / 3 = 1659.3333333333 (the remainder is 1, so 3 is not a divisor of 4978)
  • ...
  • 4978 / 69 = 72.144927536232 (the remainder is 10, so 69 is not a divisor of 4978)
  • 4978 / 70 = 71.114285714286 (the remainder is 8, so 70 is not a divisor of 4978)