What are the divisors of 5970?

1, 2, 3, 5, 6, 10, 15, 30, 199, 398, 597, 995, 1194, 1990, 2985, 5970

8 even divisors

2, 6, 10, 30, 398, 1194, 1990, 5970

8 odd divisors

1, 3, 5, 15, 199, 597, 995, 2985

How to compute the divisors of 5970?

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

  • 5970 / 1 = 5970 (the remainder is 0, so 1 is a divisor of 5970)
  • 5970 / 2 = 2985 (the remainder is 0, so 2 is a divisor of 5970)
  • 5970 / 3 = 1990 (the remainder is 0, so 3 is a divisor of 5970)
  • ...
  • 5970 / 5969 = 1.00016753225 (the remainder is 1, so 5969 is not a divisor of 5970)
  • 5970 / 5970 = 1 (the remainder is 0, so 5970 is a divisor of 5970)

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 5970 (i.e. 77.265775088327). 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 )

  • 5970 / 1 = 5970 (the remainder is 0, so 1 and 5970 are divisors of 5970)
  • 5970 / 2 = 2985 (the remainder is 0, so 2 and 2985 are divisors of 5970)
  • 5970 / 3 = 1990 (the remainder is 0, so 3 and 1990 are divisors of 5970)
  • ...
  • 5970 / 76 = 78.552631578947 (the remainder is 42, so 76 is not a divisor of 5970)
  • 5970 / 77 = 77.532467532468 (the remainder is 41, so 77 is not a divisor of 5970)