Greatest Common
Divisor - GCD
and Euclidean Algorithm
Definition
• The GCD is the greatest number that divides a set of numbers
without leaving a remainder. For example: GCD of 4 and 6 is
2, as it divides both numbers and is the largest of all their
factors.
• The GCD of any two numbers is never negative or 0, and the
least positive integer common to any two numbers is always
1.
Example
Algorithm of finding GCD
Example
Methods to Find GCD
• Prime Factorization Method
• Euclid’s Division Algorithm
• Binary GCD Algorithm (Stein's Algorithm)
Prime Factorization Method to Find GCD
Euclid’s Division Algorithm
Binary GCD Algorithm (Stein's
Algorithm)
Euclidean algorithms
• The Euclidean Division Algorithm is a method used in
mathematics to find the greatest common divisor (GCD) of
two integers. It is based on Euclid's Division Lemma. In this
algorithm, we repeatedly divide and find remainders until
the remainder becomes zero.
Euclid Division Lemma
Pseudocode of GCD
GCD Euclidean algorithm and Eulers formula
GCD Euclidean algorithm and Eulers formula

GCD Euclidean algorithm and Eulers formula