Greatest Common Divisor (GCD)

Let a and b be integers not both zero. The largest integer d such that d | a and d | b is called the greatest common divisor of a and b and is denoted gcd(a,b).

The integers a and b are said to be relatively prime if gcd(a,b) = 1.

Finding the GCD of two integers is easy if their prime factorizations are known. When they are not known the Euclidean Algorithm for finding the GCD can be used.