What are the divisors of 7038?

1, 2, 3, 6, 9, 17, 18, 23, 34, 46, 51, 69, 102, 138, 153, 207, 306, 391, 414, 782, 1173, 2346, 3519, 7038

12 even divisors

2, 6, 18, 34, 46, 102, 138, 306, 414, 782, 2346, 7038

12 odd divisors

1, 3, 9, 17, 23, 51, 69, 153, 207, 391, 1173, 3519

How to compute the divisors of 7038?

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

  • 7038 / 1 = 7038 (the remainder is 0, so 1 is a divisor of 7038)
  • 7038 / 2 = 3519 (the remainder is 0, so 2 is a divisor of 7038)
  • 7038 / 3 = 2346 (the remainder is 0, so 3 is a divisor of 7038)
  • ...
  • 7038 / 7037 = 1.0001421060111 (the remainder is 1, so 7037 is not a divisor of 7038)
  • 7038 / 7038 = 1 (the remainder is 0, so 7038 is a divisor of 7038)

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 7038 (i.e. 83.892788724657). 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 )

  • 7038 / 1 = 7038 (the remainder is 0, so 1 and 7038 are divisors of 7038)
  • 7038 / 2 = 3519 (the remainder is 0, so 2 and 3519 are divisors of 7038)
  • 7038 / 3 = 2346 (the remainder is 0, so 3 and 2346 are divisors of 7038)
  • ...
  • 7038 / 82 = 85.829268292683 (the remainder is 68, so 82 is not a divisor of 7038)
  • 7038 / 83 = 84.795180722892 (the remainder is 66, so 83 is not a divisor of 7038)