What are the divisors of 4026?

1, 2, 3, 6, 11, 22, 33, 61, 66, 122, 183, 366, 671, 1342, 2013, 4026

8 even divisors

2, 6, 22, 66, 122, 366, 1342, 4026

8 odd divisors

1, 3, 11, 33, 61, 183, 671, 2013

How to compute the divisors of 4026?

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

  • 4026 / 1 = 4026 (the remainder is 0, so 1 is a divisor of 4026)
  • 4026 / 2 = 2013 (the remainder is 0, so 2 is a divisor of 4026)
  • 4026 / 3 = 1342 (the remainder is 0, so 3 is a divisor of 4026)
  • ...
  • 4026 / 4025 = 1.000248447205 (the remainder is 1, so 4025 is not a divisor of 4026)
  • 4026 / 4026 = 1 (the remainder is 0, so 4026 is a divisor of 4026)

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 4026 (i.e. 63.450768316861). 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 )

  • 4026 / 1 = 4026 (the remainder is 0, so 1 and 4026 are divisors of 4026)
  • 4026 / 2 = 2013 (the remainder is 0, so 2 and 2013 are divisors of 4026)
  • 4026 / 3 = 1342 (the remainder is 0, so 3 and 1342 are divisors of 4026)
  • ...
  • 4026 / 62 = 64.935483870968 (the remainder is 58, so 62 is not a divisor of 4026)
  • 4026 / 63 = 63.904761904762 (the remainder is 57, so 63 is not a divisor of 4026)