Discrete MathematicsDivisibility, Primes and Greatest Common Divisors3 of 6
Divisibility, Primes and Greatest Common Divisors · 3
Primes and the Fundamental Theorem of Arithmetic
When we build whole numbers by adding, every number breaks down into a pile of 1s, so we want to know what basic building blocks numbers are made of when we break them apart using multiplication instead.
Prime Factorizations and the Fundamental Theorem of Arithmetic
To find the multiplicative building blocks of a number like 60, we split it into smaller factors until every branch reaches a number that cannot be broken down any further.
Text solution
Split composite numbers until every branch reaches a primeBreak 60 into any factor pair bigger than 1, and keep splitting the composite pieces until only unbreakable primes remain:
Sort the prime blocks from smallest to largestGroup identical prime blocks together with exponents to write the unique prime factorization of 60:
60=2×2×3×5=22×3×5
No matter which factor pair splits a composite number at each branch of a factor tree, the unbreakable prime leaves at the bottom always sort into the exact same row of prime blocks.
Splitting 90 any way you like changes the middle branches, but always leaves the exact same prime blocks at the bottom.
This gives us the core rule for how whole numbers are built by multiplication:
Fundamental Theorem of ArithmeticEvery whole number n>1 can bewritten as a product of primesin one unique way(up to the order of the factors).
1
Proving Every Number Factors into Primes
Drawing factor trees for a few numbers makes it feel obvious that the branches always end at primes, so now we want to prove that every whole number n≥2 can be written as a product of primes.
When a composite number splits into n=a×b, the factors jump way down to smaller numbers like 6 and 10 rather than stepping back by one to n−1. That is why we use strong induction, where proving the statement for n allows us to assume it already holds for every smaller number from 2 all the way up to n−1.
Proving Every Number Factors into Primes
Strong induction turns the factor tree directly into a formal proof.
Text solution
Base case (n=2)The first whole number greater than 1 is already prime, so it is a product of a single prime:
n=2(prime)
Inductive hypothesis (2 to n−1)For a whole number n>2, assume every whole number k with 2≤k≤n−1 can be written as a product of primes.
Split n into prime and composite casesIf n is prime, it is already a product of one prime; if n is composite, split it into two smaller factors a and b and multiply their prime factorizations together:
n=2≤a<na×2≤b<nb=(primes of a)×(primes of b)
2
Testing for Primes with the Square Root Bound
Now that we know every number is built from primes, we need a fast way to tell whether a larger number like 143 or 137 is prime or composite without dividing by every number up to n−1.
Testing for Primes with the Square Root Bound
Because factors come in pairs that balance around n, any composite number n=a×b must have at least one factor less than or equal to n, and that factor itself is built out of primes:
To test if n is prime,only test prime divisors p≤n.
Here is how the square root bound checks 143 and 137 in just five steps.
Text solution
Find the primes up to nBecause 122=144, both 143 and 137 are under 12, leaving only five primes to test:
Primes ≤143<12:2,3,5,7,11
Test 143 up to 11The primes 2,3,5, and 7 leave remainders, while 11 divides evenly and gives us its partner 13 above the square root:
143=110+33=11×10+11×3=11×13(composite)
Test 137 up to 11Every prime up to 11 leaves a remainder, so no larger factor can have a partner below 137:
137=7×20−3=11×12+5(prime)
3
Divisibility and Euclid's Lemma
Writing numbers as piles of prime blocks turns division into counting blocks, which lets us answer when a divisor of a product a×b is forced to divide a or b individually.
Divisibility and Euclid's Lemma
60=
2
×
2
×
3
×
5
12∣60?
Comparing prime piles shows immediately why a prime divisor behaves differently from a composite divisor when dividing a product.
Text solution
Pull out matching blocks to check divisibilityBecause 12=2×2×3 sits inside 60's prime pile {2,2,3,5}, pulling those blocks out leaves the quotient 5, whereas 8=2×2×2 needs three 2s and cannot divide 60:
60÷12=2×2×32×2×312×5=5,8 (three 2s)2×2×2∤60 (only two 2s)2×2×3×5
Use Euclid's Lemma for a prime divisorBecause 7 is a single unbreakable prime block, it cannot split across 15 and x:
7∣(15×x)and7∤15⟹7∣x
Split blocks across factors for a composite divisorBecause 6=2×3 is composite and 15=3×5 already supplies the 3,x only needs to supply the 2:
15×x=(3×5)×2=30=6×5(so x=2 workseven though 6∤2)
Whenever the divisor is a prime number p, it cannot split its pieces across two factors:
Euclid’s Lemma: If p is prime and p∣(a×b),then p∣a or p∣b.
When you move prime blocks between the two piles a and b without changing the combined pile a×b, a composite divisor like 6=2×3 can split its blocks across both piles so it divides a×b without dividing a or b. A prime divisor like 5 is a single block, so it always sits entirely in a or entirely in b.
A composite divisor of a product can split its prime pieces between the two factors, while a prime divisor is a single block that always sits entirely in one factor or the other.
4
Prime Factors of Squares and the Irrationality of 2
Next, we want to see what happens to a number's prime blocks when we square it, and use that count to prove that 2 is irrational (cannot be written as a fraction ba of whole numbers).
Prime Factors of Squares and the Irrationality of √2
6=
2
×
3
6×6=36
=
2
×
3
×
2
×
3
Counting the prime block 2 on each side shows why no fraction of whole numbers can ever square to 2.
Text solution
Square the fraction and clear the denominatorSuppose for contradiction that 2=ba for positive whole numbers a and b, and rewrite the equation with whole-number squares:
2=ba⟹2=b2a2⟹a2=2×b2
Compare the count of 2s on each sideSquaring doubles every prime pile, so a2 and b2 each have an even number of 2s, while the extra 2 out front makes the count on the right side odd:
even number of 2sa2=odd number of 2s2×b2even number of 2s
Reach the contradiction via unique factorizationBy the Fundamental Theorem of Arithmetic, the same number cannot have both an even number of 2s and an odd number of 2s in its unique prime factorization, so 2 is irrational.
5
Infinitely Many Primes
Finally, we want to know whether the prime numbers eventually run out as numbers get huge, or whether there are infinitely many primes.
Remember from the division algorithm that if you take an exact multiple of a number p and add 1, the result p×q+1 leaves a remainder of 1 when divided by p, so p cannot divide it evenly.
Infinitely Many Primes
118 elements
2
3
5
7
11
⋯
?
Euclid's construction uses that remainder of 1 to show that any finite list of primes is missing at least one prime.
Text solution
Multiply the entire list of primes and add 1Given any finite list of primes p1,p2,…,pk, build the number N by adding 1 to their product:
N=(p1×p2×⋯×pk)+1
Check the remainder for every prime on the listDividing N by any prime pi on the list leaves a remainder of 1, so no prime on the list divides N:
N=pi×(product of theother primes)+remainder =01⟹pi∤N
Factor N into primesBecause N>1, it must have at least one prime factor, and since none of p1,…,pk divide N, that prime factor must be a brand-new prime missing from the list.
Be careful not to write that N=(p1×⋯×pk)+1 is automatically prime itself: for the first six primes, 2×3×5×7×11×13+1=30,031=59×509 is composite, and the new primes are its prime factors 59 and 509.
Key concepts
Unique prime piles (Fundamental Theorem of Arithmetic)
Every whole number n≥2 breaks down into one unique pile of primes (60=22×3×5). To check if d∣n, compare their prime piles to see if d's blocks sit inside n's pile (12=22×3 sits inside 60, while 8=23 does not because 60 only has two 2s). When proving a property of factor trees for all n≥2, use strong induction rather than regular induction because splitting n=a×b jumps down to smaller factors rather than n−1.
Testing if n is prime (Square root bound)
Only test prime divisors p≤n (for 137<122, test only 2,3,5,7,11). Skip composite numbers below n because their prime blocks were already tested, and stop at n because any larger factor would need a partner below n.
Dividing a product a×b (Euclid's Lemma)
Check whether the divisor is prime before splitting across a product. If p is prime and p∣(a×b), then p∣a or p∣b(7∣15x⟹7∣x). Do not apply Euclid's Lemma to a composite divisor: 6∣15x does not force 6∣x, because 6=2×3 can take its 3 from 15 and only needs x=2.
Squares and irrational roots (Even vs. odd prime counts)
Every perfect square has an even number of every prime block (122=24×32). To prove a root is irrational, clear the denominator (2=ba⟹a2=2b2) and pick a prime whose count is even on one side and odd on the other.
Finding missing primes (Euclid's construction)
From any finite list of primes p1,…,pk, form N=(p1×⋯×pk)+1 so every pi leaves remainder 1; then take a prime factor of N rather than assuming N itself is prime (30,030+1=30,031=59×509).
6
Practice
1
Find the prime factorization of 252. Then, by comparing piles of prime blocks, determine whether 18 divides 252 and whether 24 divides 252, and give the quotient whenever the division is even.
Break 252,18, and 24 into their prime piles, and check whether 252 has enough copies of each prime block to pull out 18 or 24.
Breaking 252 down gives:
252=2×2×3×3×7=22×32×7
For 18=2×3×3, its prime blocks {2,3,3} sit inside 252's pile {2,2,3,3,7}. Pulling {2,3,3} out leaves {2,7} (be careful not to drop the second 2 when crossing out the single 2 from 18, which would give the wrong quotient 7). Multiplying the remaining blocks shows that 18 divides 252 with quotient 2×7=14.
For 24=2×2×2×3, do not just check that the distinct primes 2 and 3 appear in 252; you must compare how many of each block are required. Because 24 requires three 2s and 252 only has two 2s, 24 does not divide 252.
2
Determine whether 179 and 221 are prime or composite by testing only prime divisors up to the square root bound. State which primes must be tested for each number.
Compare 179 and 221 to nearby perfect squares like 132=169,142=196, and 152=225 to find the largest prime you need to test.
For 179, since 132=169 and 142=196, we have 179<14, so we only test the primes 2,3,5,7,11, and 13. None of them divide 179(179 is odd; 1+7+9=17; it does not end in 0 or 5;179=7×25+4;179=11×16+3;179=13×13+10), so 179 is prime.
For 221, since 142=196 and 152=225, we have 221<15, so we test the same primes 2,3,5,7,11, and 13 (do not stop at 11 after testing the easier primes, or you will falsely mark 221 as prime). Checking 2,3,5,7, and 11 leaves non-zero remainders, but 221=130+91=13×17, so 221 is composite.
3
Find the smallest positive whole number k such that 504×k is a perfect square, and use prime blocks to find the square root of 504×k.
Do not include a 3 in k just because 3 is one of the prime factors of 504 (multiplying by 2×3×7=42 would turn 32 into 33 and ruin the square).
Factor 504 into primes and see which prime blocks appear an odd number of times.
Factoring 504 gives:
504=8×63=23×32×71
A perfect square must have an even number of every prime block. In 504, the count of 3s is already even (two 3s), while the counts of 2s (three 2s) and 7s (one 7) are odd. Do not include a 3 in k just because 3 is one of the prime factors of 504 (multiplying by 2×3×7=42 would turn 32 into 33 and ruin the square). To make every count even with the smallest multiplier, k only supplies one 2 and one 7, so k=2×7=14.
Then 504×14=24×32×72. Splitting the prime blocks into two identical halves divides each exponent by 2 (giving 22=4, not a single 2 which would give 42), so 504×14=22×3×7=84.
4
Let x be a positive whole number. (a) If 11 divides 24x, must 11 divide x? Explain why or give a counterexample. (b) If 12 divides 18x, must 12 divide x? If not, find the smallest positive whole number x for which 12 divides 18x.
Do not apply Euclid's Lemma to 12 and conclude from 12∤18 that 12∣x (which gives the wrong minimum x=12), because 12=22×3 is composite and can split its prime blocks between 18 and x.
Check whether the divisor is prime or composite before deciding if its prime blocks can split between the two factors.
(a) Yes. Because 11 is prime and 11∣(24×x), Euclid's Lemma guarantees that 11∣24 or 11∣x. Since 11 does not divide 24,11 must divide x.
(b) No. Do not apply Euclid's Lemma to 12 and conclude from 12∤18 that 12∣x (which gives the wrong minimum x=12), because 12=22×3 is composite and can split its prime blocks between 18 and x. Since 18=2×32 already supplies one 2 and one 3,x only needs to supply one more 2, so the smallest such positive whole number is x=2.
5
Suppose someone claims that {3,5,7} is a complete list of all prime numbers, and you apply Euclid's construction N=(3×5×7)+1. Is N prime or composite? Find the prime factorization of N and explain why none of its prime factors are in {3,5,7}.
Compute N first and check if it is even before deciding whether N itself is prime.
Multiplying the list and adding 1 gives N=105+1=106. Do not assume N is prime just because it came from Euclid's formula (p1×⋯×pk)+1:106 is even, so it is composite and factors into primes as 106=2×53. Because 106=3×35+1=5×21+1=7×15+1 leaves a remainder of 1 when divided by 3,5, or 7, none of the primes in {3,5,7} divide 106, which forces its prime factors 2 and 53 to be primes missing from {3,5,7}.
6
Prove by contradiction that 12 is irrational by counting prime blocks.
Factor 12 into primes in the equation a2=12b2, and look for a prime block in 12 that appears an odd number of times.
Suppose, for the sake of contradiction, that 12=ba for some positive whole numbers a and b. Squaring both sides and multiplying by b2 gives:
a2=12b2=22×3×b2
Every perfect square has an even number of every prime in its prime factorization. Notice that counting 2s will not give a contradiction here, because 12 already has two 2s, leaving an even number of 2s on both sides; instead, count the prime 3. Both a2 and b2 have an even number of 3s, and multiplying b2 by 22×3 adds one extra 3, so the right side 22×3×b2 has an odd number of 3s. By the Fundamental Theorem of Arithmetic, the same number cannot have both an even number of 3s (on the left) and an odd number of 3s (on the right) in its unique prime factorization. This contradiction proves that 12 is irrational.
7
Each time you branch a composite number in a factor tree into two smaller factors, call that one split. Prove by strong induction on k≥1 that any factor tree that breaks a number down into k prime blocks at the bottom uses exactly k−1 splits, no matter which splits are chosen.
After the starting number splits once into two branches with j prime blocks and k−j prime blocks, add that first split to the splits used inside each branch.
Base case (k=1): A factor tree ending in 1 prime block starts with a prime number, which cannot be split, so it uses 0=1−1 splits.
Inductive stepLet k>1, and assume by strong induction that for every whole number j with 1≤j<k, any factor tree ending in j prime blocks uses j−1 splits (regular induction assuming only k−1 is not enough, because the first split can divide the k primes into two subtrees of any sizes j and k−j). Consider a factor tree for a number n that ends in k prime blocks. Since k>1,n is composite and first splits into two factors a and b(1 split). Suppose the subtree under a ends in j prime blocks and the subtree under b ends in the remaining k−j prime blocks. Because a≥2 and b≥2, each subtree has at least 1 prime block, so 1≤j<k and 1≤k−j<k. By the strong induction assumption, a's subtree uses j−1 splits and b's subtree uses (k−j)−1 splits. Adding the initial split of n into a and b (do not forget to add this 1, or the sum comes out to k−2) gives 1+(j−1)+(k−j−1)=k−1 splits.