TExcelTAD
Home › School Integers, Rational Numbers & Proportions › Greatest Common Divisor via Prime Factorization

Greatest Common Divisor via Prime Factorization

When simplifying fractions to lowest terms or dividing objects into equal groups without leftovers, we need to find the largest whole number that divides evenly into two or more numbers. This number is the Greatest Common Divisor (GCD), also known as the Highest Common Factor (HCF).

While listing all factors works for tiny numbers, prime factorization provides a foolproof, systematic pencil-and-paper technique that scales effortlessly to large numbers.


1. Concepts & Paper Visuals

What is the Greatest Common Divisor?

For two positive integers aa and bb:

  • A common divisor is a whole number that divides both aa and bb with remainder 00.
  • The Greatest Common Divisor, denoted gcd⁡(a,b)\gcd(a, b), is the largest of these common divisors.

Example by Factor Listing:

  • Divisors of 2424: {1,2,3,4,6,8,12,24}\{1, 2, 3, 4, \mathbf{6}, 8, 12, 24\}
  • Divisors of 3030: {1,2,3,5,6,10,15,30}\{1, 2, 3, 5, \mathbf{6}, 10, 15, 30\}
  • Common divisors: {1,2,3,6}\{1, 2, 3, 6\}
  • Greatest Common Divisor: gcd⁡(24,30)=6\gcd(24, 30) = 6.

The Venn Diagram of Prime Factors

Every prime factor of a number is like an ingredient. If we place the prime factors of two numbers into a Venn diagram, the overlapping region (intersection) contains the prime factors that both numbers share.

       Prime Factors of 48           Prime Factors of 72
       ┌────────────────────┬─────────────┬────────────────────┐
       │                    │    Shared   │                    │
       │       2            │   2, 2, 2   │         3          │
       │                    │      3      │                    │
       └────────────────────┴─────────────┴────────────────────┘
                                └────┬────┘
                    GCD = 2 × 2 × 2 × 3 = 24

The product of all primes inside the shared overlap is the Greatest Common Divisor!


The Fundamental Rule: The Minimum Power Rule

When numbers are expressed in canonical prime factorization form:

a=p1a1×p2a2×⋯×pkaka = p_1^{a_1} \times p_2^{a_2} \times \dots \times p_k^{a_k}
b=p1b1×p2b2×⋯×pkbkb = p_1^{b_1} \times p_2^{b_2} \times \dots \times p_k^{b_k}

The Minimum Power Rule for GCD: To construct the GCD, take each common prime factor raised to the lowest (minimum) exponent found in the factorizations:

gcd⁡(a,b)=p1min⁡(a1,b1)×p2min⁡(a2,b2)×…\gcd(a, b) = p_1^{\min(a_1, b_1)} \times p_2^{\min(a_2, b_2)} \times \dots

Why the Minimum Exponent?

A common divisor must be able to divide into both numbers without exceeding either number's available factors:

  • If aa has 242^4 (44 twos) and bb has 232^3 (33 twos), both numbers share at most 33 twos. 242^4 cannot divide bb because bb only has three twos. Therefore, the shared power is min⁡(4,3)=3\min(4, 3) = 3.

2. Two Paper Methods for Finding GCD

Method 1: Prime Factor Alignment on Paper

  1. Write the prime factorization of each number in exponential form.
  2. Align matching prime bases in vertical columns.
  3. For each shared prime base, circle the one with the smaller exponent.
  4. Multiply these circled prime powers to compute the GCD. (Note: If a prime appears in only one number, its exponent in the other number is 00, so min⁡(a,0)=0\min(a, 0) = 0, meaning we exclude it entirely!)
48=24×3172=23×32gcd⁡(48,72)=2min⁡(4,3)×3min⁡(1,2)=23×31=8×3=24\begin{array}{rcccc} 48 & = & 2^4 & \times & 3^1 \\ 72 & = & 2^3 & \times & 3^2 \\ \hline \gcd(48, 72) & = & 2^{\min(4, 3)} & \times & 3^{\min(1, 2)} \\ & = & 2^3 & \times & 3^1 = 8 \times 3 = \mathbf{24} \end{array}

Method 2: The Simultaneous Division Ladder

In this compact notebook technique, we place both numbers side-by-side inside a single ladder bracket. We only divide when a prime factor divides both numbers simultaneously.

24872224362121836923\begin{array}{r|cc} \mathbf{2} & 48 & 72 \\ \hline \mathbf{2} & 24 & 36 \\ \hline \mathbf{2} & 12 & 18 \\ \hline \mathbf{3} & 6 & 9 \\ \hline & 2 & 3 \end{array}
  1. Look at 4848 and 7272. Both are even   ⟹  \implies divide both by 22, giving 2424 and 3636.
  2. Both are even   ⟹  \implies divide both by 22, giving 1212 and 1818.
  3. Both are even   ⟹  \implies divide both by 22, giving 66 and 99.
  4. Now 99 is odd, but both 66 and 99 divide by 3  ⟹  3 \implies divide both by 33, giving 22 and 33.
  5. The remaining numbers 22 and 33 share no factors other than 11 (they are coprime). Stop!
  6. The GCD is the product of the numbers down the left vertical bar:
    gcd⁡=2×2×2×3=24\gcd = 2 \times 2 \times 2 \times 3 = 24

3. Step-by-Step Notebook Examples

Example 1: GCD of 90 and 168

Problem: Find gcd⁡(90,168)\gcd(90, 168) on paper using prime factorization.

  • Step 1: Factor 90:
    90=9×10=(32)×(2×5)=21×32×5190 = 9 \times 10 = (3^2) \times (2 \times 5) = 2^1 \times 3^2 \times 5^1
  • Step 2: Factor 168:
    • 168÷2=84168 \div 2 = 84
    • 84÷2=4284 \div 2 = 42
    • 42÷2=2142 \div 2 = 21
    • 21=3×721 = 3 \times 7
    168=23×31×71168 = 2^3 \times 3^1 \times 7^1
  • Step 3: Align and choose minimum powers:
    90=21×32×51168=23×31×  71gcd⁡(90,168)=2min⁡(1,3)×3min⁡(2,1)=21×31=6\begin{array}{rccccccc} 90 & = & 2^1 & \times & 3^2 & \times & 5^1 & \\ 168 & = & 2^3 & \times & 3^1 & & & \times \; 7^1 \\ \hline \gcd(90, 168) & = & 2^{\min(1, 3)} & \times & 3^{\min(2, 1)} & & & \\ & = & 2^1 & \times & 3^1 & = & \mathbf{6} \end{array}
    (Notice: 55 is only in 9090, and 77 is only in 168168, so neither belongs in the common divisor).
  • Final Answer:
    gcd⁡(90,168)=6\gcd(90, 168) = 6

Example 2: Coprime Numbers (Relatively Prime)

Problem: Find gcd⁡(35,64)\gcd(35, 64).

  • Factor 35:
    35=51×7135 = 5^1 \times 7^1
  • Factor 64:
    64=2664 = 2^6
  • Analysis:
    • 3535 has prime factors {5,7}\{5, 7\}.
    • 6464 has prime factor {2}\{2\}.
    • There are no shared prime factors!
  • When two numbers share no prime factors, their only common divisor is 11.
  • Definition: Two numbers whose GCD is 11 are called coprime (or relatively prime).
  • Final Answer:
    gcd⁡(35,64)=1\gcd(35, 64) = 1

Example 3: GCD of Three Numbers

Problem: Find gcd⁡(60,84,132)\gcd(60, 84, 132) using the simultaneous division ladder.

26084132230426631521335711\begin{array}{r|ccc} \mathbf{2} & 60 & 84 & 132 \\ \hline \mathbf{2} & 30 & 42 & 66 \\ \hline \mathbf{3} & 15 & 21 & 33 \\ \hline & 5 & 7 & 11 \end{array}
  • Steps on Paper:
    1. All three numbers are even   ⟹  \implies divide all by 2  ⟹  (30,42,66)2 \implies (30, 42, 66).
    2. All three numbers are still even   ⟹  \implies divide all by 2  ⟹  (15,21,33)2 \implies (15, 21, 33).
    3. All three are divisible by 3  ⟹  3 \implies divide all by 3  ⟹  (5,7,11)3 \implies (5, 7, 11).
    4. The numbers 5,7,115, 7, 11 are all prime and share no common factor. Stop!
  • Multiply the left column:
    gcd⁡(60,84,132)=2×2×3=12\gcd(60, 84, 132) = 2 \times 2 \times 3 = 12
  • Verification:
    • 60÷12=560 \div 12 = 5
    • 84÷12=784 \div 12 = 7
    • 132÷12=11132 \div 12 = 11 Since 5,7,115, 7, 11 share no common factors, 1212 is indeed the greatest common divisor!
  • Final Answer:
    gcd⁡(60,84,132)=12\gcd(60, 84, 132) = 12

4. Common Mistakes & Paper Traps

[!WARNING] Trap 1: Choosing the largest power instead of the smallest. When looking at 242^4 and 232^3, students instinctively want to pick 242^4 because the word is "Greatest Common Divisor".

  • Remember: The divisor must fit inside both numbers! A larger power cannot divide a smaller power.
  • Rule: For GCD, pick the smallest (minimum) exponent!

[!WARNING] Trap 2: Including unshared prime factors. If aa has a factor of 55 but bb does not, 55 cannot be a common factor. Never include unshared primes in a GCD.

[!WARNING] Trap 3: Continuing the simultaneous ladder when only two numbers divide. For the GCD of three numbers, a prime must divide all three numbers. If a prime divides only two of them, you cannot use it for GCD! (That rule applies only to LCM).


5. Pencil & Paper Practice

Solve these on your notebook page:

  1. Practice 1: Find gcd⁡(54,90)\gcd(54, 90) using prime factorization.
  2. Practice 2: Find gcd⁡(126,210)\gcd(126, 210) using the simultaneous division ladder.
  3. Practice 3: Are 2828 and 4545 coprime? Justify on paper.

6. Worked Solutions for Practice Problems

Solution to Practice 1

  • Prime factorizations:
    54=2×27=21×3390=9×10=21×32×51\begin{aligned} 54 &= 2 \times 27 = 2^1 \times 3^3 \\ 90 &= 9 \times 10 = 2^1 \times 3^2 \times 5^1 \end{aligned}
  • Shared primes: 22 and 33.
  • Minimum exponents: 212^1 and 3min⁡(3,2)=323^{\min(3, 2)} = 3^2.
  • gcd⁡(54,90)=21×32=2×9=18\gcd(54, 90) = 2^1 \times 3^2 = 2 \times 9 = \mathbf{18}.

Solution to Practice 2

  • Simultaneous ladder:
    21262103631057213535\begin{array}{r|cc} 2 & 126 & 210 \\ \hline 3 & 63 & 105 \\ \hline 7 & 21 & 35 \\ \hline & 3 & 5 \end{array}
  • gcd⁡(126,210)=2×3×7=42\gcd(126, 210) = 2 \times 3 \times 7 = \mathbf{42}.

Solution to Practice 3

  • Factor 28=22×728 = 2^2 \times 7.
  • Factor 45=32×545 = 3^2 \times 5.
  • There are no shared prime factors: gcd⁡(28,45)=1\gcd(28, 45) = 1.
  • Yes, 2828 and 4545 are coprime.

7. Summary

  • GCD / HCF: The greatest integer that divides all given numbers without a remainder.
  • Venn Diagram view: The product of all prime factors located in the shared intersection.
  • Formula: gcd⁡(a,b)=∏pimin⁡(ai,bi)\gcd(a, b) = \prod p_i^{\min(a_i, b_i)} (take each shared prime to its lowest exponent).
  • Coprime: Numbers with gcd⁡=1\gcd = 1.

Test yourself

Given the prime factorizations A=23×32×5A = 2^3 \times 3^2 \times 5 and B=22×34×7B = 2^2 \times 3^4 \times 7, what is gcd⁡(A,B)\gcd(A, B)?

  1. 23×34×5×72^3 \times 3^4 \times 5 \times 7
  2. 22×322^2 \times 3^2
  3. 21×312^1 \times 3^1
  4. 23×322^3 \times 3^2

What is the Greatest Common Divisor of 4545 and 105105?

  1. 33
  2. 55
  3. 1515
  4. 3535

Two numbers are described as 'coprime'. What does this mean?

  1. Both numbers must be prime numbers
  2. Their sum is a prime number
  3. Their Greatest Common Divisor is 11
  4. One number is a multiple of the other