Skip to main content

Primes, Composites, and the Fundamental Theorem

Every positive integer falls into one of three categories:

  1. The unit (11): Has only one positive divisor (11). It is neither prime nor composite.
  2. Prime numbers (2,3,5,7,11,13,17,19,…2, 3, 5, 7, 11, 13, 17, 19, \dots): Integers greater than 11 with exactly two positive divisors (11 and itself). Notice that 22 is the only even prime number.
  3. Composite numbers (4,6,8,9,10,12,…4, 6, 8, 9, 10, 12, \dots): Integers greater than 11 that have more than two positive divisors and can be built by multiplying smaller integers.

Primes are the atoms of arithmetic. Just as every molecule is built from a specific combination of chemical elements, the Fundamental Theorem of Arithmetic states:

Every integer n>1n > 1 can be written as a product of prime numbers in exactly one way (up to the order in which the factors are written).

For example, 360360 can be factored along many different paths (36×1036 \times 10, or 20×1820 \times 18, or 8×458 \times 45), but every path ends at the exact same prime-power signature:

360=23×32×5360 = 2^3 \times 3^2 \times 5

Two Methods to Find Prime Factorization

Method 1: Factor Trees (Visual Splitting)

Split the number into any two factors greater than 11. Circle any prime number you encounter, and keep splitting composite branches until every leaf is prime.

Method 2: Trial Division (Systematic Ladder)

When factoring by hand or in code, divide by the smallest prime (22) repeatedly until odd, then test 3,5,7,11,…3, 5, 7, 11, \dots up to n\sqrt{n}:

  • 360÷2=180360 \div 2 = 180
  • 180÷2=90180 \div 2 = 90
  • 90÷2=4590 \div 2 = 45 (no longer divisible by 22)
  • 45÷3=1545 \div 3 = 15
  • 15÷3=515 \div 3 = 5 (55 is prime—stop!)

Quick Divisibility Shortcuts:

  • 22: Last digit is even.
  • 33: Sum of digits is divisible by 33 (e.g., 4+5=94 + 5 = 9).
  • 55: Last digit is 00 or 55.
  • 99: Sum of digits is divisible by 99.

Greatest Common Divisor (GCD) and Least Common Multiple (LCM)

Once two numbers are written in prime-power form, you can read off both their GCD (also called Greatest Common Factor, GCF) and LCM immediately:

  • GCD (Shared Core / Intersection): Take every prime present in both factorizations with the smallest exponent.
  • LCM (Combined Envelope / Union): Take every prime present in either factorization with the largest exponent.
PrimeIn 360360In 150150GCD (Min)LCM (Max)
22232^3212^1212^1232^3
33323^2313^1313^1323^2
55515^1525^2515^1525^2
Product36036015015030301,8001{,}800

Notice the fundamental product law connecting them:

GCD(a,b)×LCM(a,b)=a×b\text{GCD}(a, b) \times \text{LCM}(a, b) = a \times b

Here, 30×1,800=54,000=360×15030 \times 1{,}800 = 54{,}000 = 360 \times 150.

The Euclidean Algorithm (Fast GCD Without Factoring)

For 20-digit or 200-digit numbers, prime factorization is prohibitively slow (in fact, modern RSA encryption relies on how hard it is to factor huge numbers). Yet Euclid’s algorithm finds the GCD in milliseconds using repeated division with remainder:

GCD(a,b)=GCD(b, a mod b)\text{GCD}(a, b) = \text{GCD}(b,\ a \bmod b)

Step-by-Step Example: GCD(360,150)\text{GCD}(360, 150)

  1. Divide 360360 by 150150: 360=2×150+60360 = 2 \times 150 + \mathbf{60}.
  2. Replace (360,150)(360, 150) with (150,60)(150, 60): 150=2×60+30150 = 2 \times 60 + \mathbf{30}.
  3. Replace (150,60)(150, 60) with (60,30)(60, 30): 60=2×30+060 = 2 \times 30 + \mathbf{0}.

When the remainder hits 00, the last nonzero remainder (3030) is the GCD. Once you know GCD(360,150)=30\text{GCD}(360, 150) = 30, you get the LCM immediately without any factor tree:

LCM(360,150)=360×15030=1,800\text{LCM}(360, 150) = \frac{360 \times 150}{30} = 1{,}800

Try any pair of integers in the Prime Factorization & GCD/LCM Tool.

Progressive Worked Examples

Example 1 (Foundational): Simplifying Fractions with GCD

Simplify 84120\dfrac{84}{120} to lowest terms.

  1. Factor both: 84=22⋅3⋅784 = 2^2 \cdot 3 \cdot 7 and 120=23⋅3⋅5120 = 2^3 \cdot 3 \cdot 5.
  2. GCD(84,120)=22⋅3=12\text{GCD}(84, 120) = 2^2 \cdot 3 = 12.
  3. Divide numerator and denominator by 1212: 84÷12120÷12=710\frac{84 \div 12}{120 \div 12} = \frac{7}{10}

Example 2 (Intermediate): Adding Fractions with LCM

Compute 512+718\dfrac{5}{12} + \dfrac{7}{18} using the Least Common Denominator (LCM(12,18)\text{LCM}(12, 18)).

  1. 12=22⋅312 = 2^2 \cdot 3 and 18=2⋅3218 = 2 \cdot 3^2.
  2. LCM(12,18)=22⋅32=36\text{LCM}(12, 18) = 2^2 \cdot 3^2 = 36.
  3. Convert both fractions to denominator 3636: 5×336+7×236=15+1436=2936\frac{5 \times 3}{36} + \frac{7 \times 2}{36} = \frac{15 + 14}{36} = \frac{29}{36}

Example 3 (Applied Word Problem): Synchronized Cycles

Two automated subway trains leave Central Station together at 8:00 AM. Line A completes a loop every 1818 minutes, and Line B completes a loop every 2424 minutes. When will both trains next arrive at Central Station at the exact same time?

  1. We need the smallest positive multiple of both 1818 and 2424: LCM(18,24)\text{LCM}(18, 24).
  2. 18=2⋅3218 = 2 \cdot 3^2 and 24=23⋅324 = 2^3 \cdot 3.
  3. LCM(18,24)=23⋅32=8×9=72\text{LCM}(18, 24) = 2^3 \cdot 3^2 = 8 \times 9 = 72 minutes.
  4. 7272 minutes after 8:00 AM is 9:12 AM.

Why It Matters

  • Fractions & Algebra: Finding common denominators, simplifying rational expressions, and factoring polynomials all rely on GCD/LCM thinking.
  • Cryptography: Internet security (HTTPS, banking, SSH) depends on the asymmetry that multiplying two 300-digit primes is instant, while factoring their product back into primes is astronomically hard.

Common Misconceptions

  • Thinking all odd numbers are prime: 9=329 = 3^2, 15=3×515 = 3 \times 5, 21=3×721 = 3 \times 7, and 91=7×1391 = 7 \times 13 are all odd and composite.
  • Confusing GCD with LCM: The GCD is always ≤\le the smaller number (it divides into both), whereas the LCM is always ≥\ge the larger number (both divide into it).
  • Forgetting to check primes up to n\sqrt{n}: To prove 9797 is prime, you only need to test primes ≤97≈9.8\le \sqrt{97} \approx 9.8, namely 2,3,5,2, 3, 5, and 77.

Quick Summary

  • Every integer n>1n > 1 has a unique prime factorization.
  • GCD: Multiply shared primes with their minimum exponents.
  • LCM: Multiply all primes with their maximum exponents.
  • Euclid’s Algorithm finds GCD(a,b)\text{GCD}(a, b) rapidly via remainders, and LCM(a,b)=a⋅bGCD(a,b)\text{LCM}(a, b) = \frac{a \cdot b}{\text{GCD}(a, b)}.

Practice Problems

Common Questions

Frequently Asked Questions