What are the divisors of 8058?

1, 2, 3, 6, 17, 34, 51, 79, 102, 158, 237, 474, 1343, 2686, 4029, 8058

8 even divisors

2, 6, 34, 102, 158, 474, 2686, 8058

8 odd divisors

1, 3, 17, 51, 79, 237, 1343, 4029

How to compute the divisors of 8058?

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

  • 8058 / 1 = 8058 (the remainder is 0, so 1 is a divisor of 8058)
  • 8058 / 2 = 4029 (the remainder is 0, so 2 is a divisor of 8058)
  • 8058 / 3 = 2686 (the remainder is 0, so 3 is a divisor of 8058)
  • ...
  • 8058 / 8057 = 1.0001241156758 (the remainder is 1, so 8057 is not a divisor of 8058)
  • 8058 / 8058 = 1 (the remainder is 0, so 8058 is a divisor of 8058)

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 8058 (i.e. 89.766363410801). 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 )

  • 8058 / 1 = 8058 (the remainder is 0, so 1 and 8058 are divisors of 8058)
  • 8058 / 2 = 4029 (the remainder is 0, so 2 and 4029 are divisors of 8058)
  • 8058 / 3 = 2686 (the remainder is 0, so 3 and 2686 are divisors of 8058)
  • ...
  • 8058 / 88 = 91.568181818182 (the remainder is 50, so 88 is not a divisor of 8058)
  • 8058 / 89 = 90.539325842697 (the remainder is 48, so 89 is not a divisor of 8058)