What are the divisors of 5090?

1, 2, 5, 10, 509, 1018, 2545, 5090

4 even divisors

2, 10, 1018, 5090

4 odd divisors

1, 5, 509, 2545

How to compute the divisors of 5090?

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

  • 5090 / 1 = 5090 (the remainder is 0, so 1 is a divisor of 5090)
  • 5090 / 2 = 2545 (the remainder is 0, so 2 is a divisor of 5090)
  • 5090 / 3 = 1696.6666666667 (the remainder is 2, so 3 is not a divisor of 5090)
  • ...
  • 5090 / 5089 = 1.0001965022598 (the remainder is 1, so 5089 is not a divisor of 5090)
  • 5090 / 5090 = 1 (the remainder is 0, so 5090 is a divisor of 5090)

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 5090 (i.e. 71.344235926948). 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 )

  • 5090 / 1 = 5090 (the remainder is 0, so 1 and 5090 are divisors of 5090)
  • 5090 / 2 = 2545 (the remainder is 0, so 2 and 2545 are divisors of 5090)
  • 5090 / 3 = 1696.6666666667 (the remainder is 2, so 3 is not a divisor of 5090)
  • ...
  • 5090 / 70 = 72.714285714286 (the remainder is 50, so 70 is not a divisor of 5090)
  • 5090 / 71 = 71.69014084507 (the remainder is 49, so 71 is not a divisor of 5090)