GCD Formulas

Master the Greatest Common Divisor with comprehensive formulas and algorithms. From basic methods to advanced techniques for finding GCD efficiently.

1GCD Definition

The Greatest Common Divisor (GCD) of two or more integers is the largest positive integer that divides each number without remainder.

Properties:

Example:

Because 6 is the largest number that divides both 48 and 18.

2Euclidean Algorithm

The most efficient method for computing GCD, based on the principle that GCD doesn't change if we replace the larger number with the remainder of division.

Algorithm Steps:

1. Given two numbers a and b where a ≥ b
2. If b = 0, then
3. Otherwise,
4. Repeat until b = 0

Example: GCD(48, 18)

3Prime Factorization Method

Find GCD by expressing each number as a product of prime factors and taking the minimum power of each common prime.

Example: GCD(60, 48)

Prime factorizations:
GCD calculation:

4Extended Euclidean Algorithm

Not only finds GCD but also finds integers x and y such that ax + by = gcd(a,b).

Bézout's Identity

For any integers a and b, there exist integers x and y such that:

This is fundamental in number theory and has applications in cryptography and solving Diophantine equations.

5GCD of Multiple Numbers

Associative Property:

Example:

6Relationship with LCM

Example:

For a = 12, b = 8:

Quick Reference

Common GCD Values

gcd(10, 15)=5
gcd(21, 35)=7
gcd(16, 24)=8
gcd(25, 35)=5

Algorithm Complexity

Euclidean Algorithm
Prime Factorization
Binary GCD