What are the divisors of 1829?

1, 31, 59, 1829

4 odd divisors

1, 31, 59, 1829

How to compute the divisors of 1829?

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

  • 1829 / 1 = 1829 (the remainder is 0, so 1 is a divisor of 1829)
  • 1829 / 2 = 914.5 (the remainder is 1, so 2 is not a divisor of 1829)
  • 1829 / 3 = 609.66666666667 (the remainder is 2, so 3 is not a divisor of 1829)
  • ...
  • 1829 / 1828 = 1.0005470459519 (the remainder is 1, so 1828 is not a divisor of 1829)
  • 1829 / 1829 = 1 (the remainder is 0, so 1829 is a divisor of 1829)

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 1829 (i.e. 42.766809560686). 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 )

  • 1829 / 1 = 1829 (the remainder is 0, so 1 and 1829 are divisors of 1829)
  • 1829 / 2 = 914.5 (the remainder is 1, so 2 is not a divisor of 1829)
  • 1829 / 3 = 609.66666666667 (the remainder is 2, so 3 is not a divisor of 1829)
  • ...
  • 1829 / 41 = 44.609756097561 (the remainder is 25, so 41 is not a divisor of 1829)
  • 1829 / 42 = 43.547619047619 (the remainder is 23, so 42 is not a divisor of 1829)