What are the divisors of 6045?

1, 3, 5, 13, 15, 31, 39, 65, 93, 155, 195, 403, 465, 1209, 2015, 6045

16 odd divisors

1, 3, 5, 13, 15, 31, 39, 65, 93, 155, 195, 403, 465, 1209, 2015, 6045

How to compute the divisors of 6045?

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

  • 6045 / 1 = 6045 (the remainder is 0, so 1 is a divisor of 6045)
  • 6045 / 2 = 3022.5 (the remainder is 1, so 2 is not a divisor of 6045)
  • 6045 / 3 = 2015 (the remainder is 0, so 3 is a divisor of 6045)
  • ...
  • 6045 / 6044 = 1.0001654533422 (the remainder is 1, so 6044 is not a divisor of 6045)
  • 6045 / 6045 = 1 (the remainder is 0, so 6045 is a divisor of 6045)

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 6045 (i.e. 77.749598069701). 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 )

  • 6045 / 1 = 6045 (the remainder is 0, so 1 and 6045 are divisors of 6045)
  • 6045 / 2 = 3022.5 (the remainder is 1, so 2 is not a divisor of 6045)
  • 6045 / 3 = 2015 (the remainder is 0, so 3 and 2015 are divisors of 6045)
  • ...
  • 6045 / 76 = 79.539473684211 (the remainder is 41, so 76 is not a divisor of 6045)
  • 6045 / 77 = 78.506493506494 (the remainder is 39, so 77 is not a divisor of 6045)