What are the divisors of 582?

1, 2, 3, 6, 97, 194, 291, 582

4 even divisors

2, 6, 194, 582

4 odd divisors

1, 3, 97, 291

How to compute the divisors of 582?

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

  • 582 / 1 = 582 (the remainder is 0, so 1 is a divisor of 582)
  • 582 / 2 = 291 (the remainder is 0, so 2 is a divisor of 582)
  • 582 / 3 = 194 (the remainder is 0, so 3 is a divisor of 582)
  • ...
  • 582 / 581 = 1.0017211703959 (the remainder is 1, so 581 is not a divisor of 582)
  • 582 / 582 = 1 (the remainder is 0, so 582 is a divisor of 582)

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 582 (i.e. 24.12467616363). 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 )

  • 582 / 1 = 582 (the remainder is 0, so 1 and 582 are divisors of 582)
  • 582 / 2 = 291 (the remainder is 0, so 2 and 291 are divisors of 582)
  • 582 / 3 = 194 (the remainder is 0, so 3 and 194 are divisors of 582)
  • ...
  • 582 / 23 = 25.304347826087 (the remainder is 7, so 23 is not a divisor of 582)
  • 582 / 24 = 24.25 (the remainder is 6, so 24 is not a divisor of 582)