The greatest common divisor (a, b) is the largest positive integer dividing both a and b.
Mathematics I259 wordsFree to read
The greatest common divisorgcd(a,b) is the largest positive integer dividing both a and b. Its partner, the least common multiplelcm(a,b), is the smallest positive integer that both a and b divide.
Factoring is slow for large numbers. The Euclidean algorithm finds gcd(a,b) instantly using the rule: gcd(a,b)=gcd(b,r) where r is the remainder of a÷b.
Step
Division
Remainder (r)
1
48=2⋅18+12
12
2
18=1⋅12+6
6
3
12=2⋅6+0
0
Repeatedly replace (a,b) with (b,r) until r=0. The last nonzero remainder is the gcd. Here, gcd(48,18)=6.
The Euclidean step made physical: squares tiled out of a rectangle
Coprime and the LCM Link
Two numbers are coprime (relatively prime) when gcd(a,b)=1, meaning they share no prime factors. This is essential for finding multiplicative inverses in modular arithmetic.
You can find the lcm instantly without factoring using the identity: gcd(a,b)⋅lcm(a,b)=a⋅b Rearranging gives lcm(a,b)=gcd(a,b)ab.
Common Pitfall: Never confuse the two terms:
Property
GCD
LCM
Meaning
Divisor of both
Multiple of both
Bound
At most the smaller
At least the larger
Example
gcd(12,18)=6
lcm(12,18)=36
Practise this lesson
The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.