gcd of 18 and 6
To calculate the GCD (greatest common divisor), we first decompose the numbers into prime factors.
18 = 2×32
6 = 2×3
We keep the common prime factors with their smallest exponent.
▶pgcd(18, 6) = 2×3 = 6