Course Computational Mathematics

Euclidean Algorithm

Course's Page 14 min Text by
User Image
Yan Silva

In this lesson, we'll talk about the Euclidean Algorithm.

Before learning the algorithm, we need to understand what it does. Basically, given two numbers and , it give us the greatest common divisor (gcd) of and .

But what is the greatest common divisor of two numbers? Greatest common divisor of and is the maximum integer such that and is a multiple of ( is a divisor of and ). For example, and .

Now, let's talk about the algorithm. It will use two gcd properties:

Proofs
  1. Since every number is a divisor of , we just have to find the greatest divisor of , which is itself

  2. Take and . By the definition of gcd, and and and . It means that must be a divisor of and and all divisors of and are valid. As is maximal, .