What are the divisors of 585?

1, 3, 5, 9, 13, 15, 39, 45, 65, 117, 195, 585

12 odd divisors

1, 3, 5, 9, 13, 15, 39, 45, 65, 117, 195, 585

How to compute the divisors of 585?

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

  • 585 / 1 = 585 (the remainder is 0, so 1 is a divisor of 585)
  • 585 / 2 = 292.5 (the remainder is 1, so 2 is not a divisor of 585)
  • 585 / 3 = 195 (the remainder is 0, so 3 is a divisor of 585)
  • ...
  • 585 / 584 = 1.0017123287671 (the remainder is 1, so 584 is not a divisor of 585)
  • 585 / 585 = 1 (the remainder is 0, so 585 is a divisor of 585)

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 585 (i.e. 24.186773244896). 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 )

  • 585 / 1 = 585 (the remainder is 0, so 1 and 585 are divisors of 585)
  • 585 / 2 = 292.5 (the remainder is 1, so 2 is not a divisor of 585)
  • 585 / 3 = 195 (the remainder is 0, so 3 and 195 are divisors of 585)
  • ...
  • 585 / 23 = 25.434782608696 (the remainder is 10, so 23 is not a divisor of 585)
  • 585 / 24 = 24.375 (the remainder is 9, so 24 is not a divisor of 585)