What are the divisors of 1850?

1, 2, 5, 10, 25, 37, 50, 74, 185, 370, 925, 1850

6 even divisors

2, 10, 50, 74, 370, 1850

6 odd divisors

1, 5, 25, 37, 185, 925

How to compute the divisors of 1850?

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

  • 1850 / 1 = 1850 (the remainder is 0, so 1 is a divisor of 1850)
  • 1850 / 2 = 925 (the remainder is 0, so 2 is a divisor of 1850)
  • 1850 / 3 = 616.66666666667 (the remainder is 2, so 3 is not a divisor of 1850)
  • ...
  • 1850 / 1849 = 1.0005408328826 (the remainder is 1, so 1849 is not a divisor of 1850)
  • 1850 / 1850 = 1 (the remainder is 0, so 1850 is a divisor of 1850)

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 1850 (i.e. 43.011626335213). 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 )

  • 1850 / 1 = 1850 (the remainder is 0, so 1 and 1850 are divisors of 1850)
  • 1850 / 2 = 925 (the remainder is 0, so 2 and 925 are divisors of 1850)
  • 1850 / 3 = 616.66666666667 (the remainder is 2, so 3 is not a divisor of 1850)
  • ...
  • 1850 / 42 = 44.047619047619 (the remainder is 2, so 42 is not a divisor of 1850)
  • 1850 / 43 = 43.023255813953 (the remainder is 1, so 43 is not a divisor of 1850)