Skip to content
← All questions

How do I use the Euclidean algorithm to find the greatest common divisor of two large numbers?

To find the greatest common divisor of two large numbers, repeatedly apply the division-with-remainder step. Start by dividing the larger number by the smaller number. Then, replace the pair with the previous divisor and the new remainder. Continue this process until the remainder is zero. The last nonzero remainder (or the divisor of the final exact division) is the greatest common divisor.

Conditions

  • The inputs are two positive integers.
  • The division algorithm is applied at each step.
  • The process stops when a remainder equals 0.

Reasoning, step by step

  1. Identify the two large numbers, for example, 1701 and 3768.
  2. Divide the larger number by the smaller number: 3768=1701⋅2+3663768 = 1701 \cdot 2 + 366.
  3. Move the previous divisor (1701) to the left side and the remainder (366) to the divisor position: 1701=366⋅4+2371701 = 366 \cdot 4 + 237.
  4. Repeat the shift and divide process: 366=237⋅1+129366 = 237 \cdot 1 + 129, 237=129⋅1+108237 = 129 \cdot 1 + 108, 129=108⋅1+21129 = 108 \cdot 1 + 21, 108=21⋅5+3108 = 21 \cdot 5 + 3.
  5. Perform the final division: 21=3⋅7+021 = 3 \cdot 7 + 0.
  6. Identify the last nonzero remainder, which is 3, as the greatest common divisor.

Example

The board shows the step-by-step division equations for gcd(1701;3768), ending with a remainder of 0. The speaker draws an arrow from the final remainder '0' to the previous remainder '3', and boxes the '3'.

Common misconceptions

  • Trying to factor the large numbers into primes first.
  • Stopping the algorithm before the remainder reaches zero.
  • Confusing the quotient with the remainder in the shift step.

Watch the explanation

Connected concepts

Explore next

Related questions

Understand why

↗
Find a method

↗
Find a method

↗
Understand why

↗
Find a method

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.