Table of Contents15 sections
Primes, Composites, and the Fundamental Theorem
Every positive integer falls into one of three categories:
- The unit (): Has only one positive divisor (). It is neither prime nor composite.
- Prime numbers (): Integers greater than with exactly two positive divisors ( and itself). Notice that is the only even prime number.
- Composite numbers (): Integers greater than 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 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, can be factored along many different paths (, or , or ), but every path ends at the exact same prime-power signature:
Two Methods to Find Prime Factorization
Method 1: Factor Trees (Visual Splitting)
Split the number into any two factors greater than . Circle any prime number you encounter, and keep splitting composite branches until every leaf is prime.
Blue circles mark prime leaves: 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.
Method 2: Trial Division (Systematic Ladder)
When factoring by hand or in code, divide by the smallest prime () repeatedly until odd, then test up to :
- (no longer divisible by )
- ( is prime—stop!)
Quick Divisibility Shortcuts:
- : Last digit is even.
- : Sum of digits is divisible by (e.g., ).
- : Last digit is or .
- : Sum of digits is divisible by .
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.
| Prime | In | In | GCD (Min) | LCM (Max) |
|---|---|---|---|---|
| Product |
Notice the fundamental product law connecting them:
Here, .
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:
Step-by-Step Example:
- Divide by : .
- Replace with : .
- Replace with : .
When the remainder hits , the last nonzero remainder () is the GCD. Once you know , you get the LCM immediately without any factor tree:
Try any pair of integers in the Prime Factorization & GCD/LCM Tool.
Progressive Worked Examples
Example 1 (Foundational): Simplifying Fractions with GCD
Simplify to lowest terms.
- Factor both: and .
- .
- Divide numerator and denominator by :
Example 2 (Intermediate): Adding Fractions with LCM
Compute using the Least Common Denominator ().
- and .
- .
- Convert both fractions to denominator :
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 minutes, and Line B completes a loop every minutes. When will both trains next arrive at Central Station at the exact same time?
- We need the smallest positive multiple of both and : .
- and .
- minutes.
- 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: , , , and are all odd and composite.
- Confusing GCD with LCM: The GCD is always the smaller number (it divides into both), whereas the LCM is always the larger number (both divide into it).
- Forgetting to check primes up to : To prove is prime, you only need to test primes , namely and .
Quick Summary
- Every integer 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 rapidly via remainders, and .
Practice Problems
1. Find the prime factorization of 252.
Answer: 2² × 3² × 7
252 ÷ 2 = 126 → 126 ÷ 2 = 63 → 63 ÷ 3 = 21 → 21 ÷ 3 = 7 (prime). Product: 2² × 3² × 7.
2. Compute GCD(48, 180) and LCM(48, 180).
Answer: GCD = 12, LCM = 720
48 = 2⁴ × 3 and 180 = 2² × 3² × 5. GCD = 2² × 3 = 12. LCM = 2⁴ × 3² × 5 = 16 × 9 × 5 = 720.
3. Use Euclid’s algorithm to find GCD(270, 192).
Answer: 6
270 = 1×192 + 78 → 192 = 2×78 + 36 → 78 = 2×36 + 6 → 36 = 6×6 + 0. Last nonzero remainder is 6.
Frequently Asked Questions
Why is 1 not considered a prime number?
If 1 were prime, prime factorization would no longer be unique (e.g., 6 = 2 × 3 = 1 × 2 × 3 = 1² × 2 × 3). Excluding 1 preserves the Fundamental Theorem of Arithmetic.
How are GCD and LCM related?
For any two positive integers a and b, GCD(a, b) × LCM(a, b) = a × b.
Which method is faster for large numbers: factor trees or Euclid's algorithm?
Euclid's division algorithm is dramatically faster for finding the GCD of large integers because it avoids factoring altogether.
How many prime numbers are there?
Infinitely many. Euclid proved over 2,300 years ago that no finite list of primes can ever contain all of them.