What are the divisors of 7046?

1, 2, 13, 26, 271, 542, 3523, 7046

4 even divisors

2, 26, 542, 7046

4 odd divisors

1, 13, 271, 3523

How to compute the divisors of 7046?

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

  • 7046 / 1 = 7046 (the remainder is 0, so 1 is a divisor of 7046)
  • 7046 / 2 = 3523 (the remainder is 0, so 2 is a divisor of 7046)
  • 7046 / 3 = 2348.6666666667 (the remainder is 2, so 3 is not a divisor of 7046)
  • ...
  • 7046 / 7045 = 1.0001419446416 (the remainder is 1, so 7045 is not a divisor of 7046)
  • 7046 / 7046 = 1 (the remainder is 0, so 7046 is a divisor of 7046)

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 7046 (i.e. 83.940455085733). 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 )

  • 7046 / 1 = 7046 (the remainder is 0, so 1 and 7046 are divisors of 7046)
  • 7046 / 2 = 3523 (the remainder is 0, so 2 and 3523 are divisors of 7046)
  • 7046 / 3 = 2348.6666666667 (the remainder is 2, so 3 is not a divisor of 7046)
  • ...
  • 7046 / 82 = 85.926829268293 (the remainder is 76, so 82 is not a divisor of 7046)
  • 7046 / 83 = 84.89156626506 (the remainder is 74, so 83 is not a divisor of 7046)