MA 118: Chapter 4 – Number Theory Section 4.2 Reminder: If d divides or is a factor of a number n, the number can be written n = d·k for some number k. Theorem: Divisibility of Sums and Differences If d, a, and b are natural numbers and d divides both a and b then d divides both their sum a b and difference and a b . Theorem: Divisibility of a Product Let a and b be natural numbers with no common factor other than 1 (Greatest Common Factor GCF = 1). Then, if a and b are both divisors of c, then ab divides c. Theorem Divisibility by 2 and 5 If n is a natural number, then n is divisible by 2 if and only if its units digit is 0, 2, 4, 6, or 8. If n is a natural number, then n is divisible by 5 if and only if its units digit is 0 or 5. Section 4.2: Tests for Divisibility Rule: Divisibility by 10 If n is a natural number, then n is divisible by 10 if and only n is divisible by 2 and 5 , that is if and only if its units digit is 0. Rule: Divisibility by 4, and 8 A natural number n is divisible by 4 if and only if 4 divides the number named by the last two digits of n. Similarly, 8 divides n, if and only if 8 divided the number named by the last 3 digits of n. In general, 2r divides n if and only if 2r divides the number named by the last r digits of n. Examples: Is n = 7,293,748 divisible by 2, 4, 8 and 16? Rule: Divisibility by 3 and 9 A natural number n is divisible by 3 if and only if the sum of its digits is divisible by 3. Similarly, a natural number is divisible by 9 if and only if the sum of its digits is divisible by 9. Example: 37,284 Section 4.2: Tests for Divisibility Rule: Divisibility by 6 If n is a natural number, then n is divisible by 6 if and only n is divisible by 2 and 3. Rule: Divisibility by 11 A natural number n is divisible by 11 if and only if the difference of the sums of its digits in the even and odd positions of the number is divisible by 11. Examples: n = 7,293,748 and n = 121 Combined Test for Divisibility by 7, 11, and 13 Example: n = 92,252,191,213 Step 1 – Break up the number into 3 digit groups: Group 1(odd) Group 2(even) Group 3(odd) Group 4 (even) 092 252 191 213 Step 2 – Add the even position digits and the odd 0 9 2 2 5 2 position digits: 191 213 283 4 6 5 Step 3 – Find the difference between the sums: 4 6 5 283 18 2 Step 4 – The original number n = 92,252,191,213 is divisible by 7 if and only the difference 182 is divisible by 7. The original number n = 92,252,191,213 is divisible by 11 if and only the difference 182 is divisible by 11. The original number n = 92,252,191,213 is divisible by 13 if and only the difference 182 is divisible by 13. Example: n = 7,293,748 Section 4.3 Greatest Common Divisors (GCD) and Least Common Multiples (LCM) Cuisenaire rods for finding d GCD(a,b) and m LCM(a,b) . Definition: If a and b are natural numbers. The largest natural number d that divides both a and b is called their greatest common divisor or greatest common factor, written d GCD(a,b) or d GCF(a,b) . Finding the greatest common divisor from intersection of sets is useful when the numbers are small. Example: Find the greatest common divisor of 12 and 42. Find D12 { } and D42 { }. Theorem: GCDs from Prime Power Representation a a Let a p11 p22... prar be the prime power representation of a and b b b p11 p22... prbr be the prime power c c GCD(a,b) p11 p22... prcr representation of b. Then where ck is the lesser of ak and bk for 0 k r . Section 4.3 Greatest Common Divisors (GCD) and Least Common Multiples (LCM) Examples: Find GCD(12,42) . Find GCD(350,420) . If a is divided by b, we obtain a bq r, 0 r b . Solving for r, r a bq . It turns out that a and b have the same set of divisors as b and r. Theorem The GCD and the Division Algorithm Let a and b be any two natural numbers and let q and r be determined by the division algorithm. So a bq r, 0 r b . Then GCD(a,b) GCD(b,r) . Example: Find GCD(124,2940) . Check using prime power representation. Notice the last non-zero remainder is the GCD. This theorem gives the Euclidean algorithm theorem. Section 4.3 Greatest Common Divisors (GCD) and Least Common Multiples (LCM) Theorem The Euclidean Algorithm Let a and b be any two natural numbers. Using the division algorithm, find q1, q2,. . . qs and r1, r2,. . . rs-1 so that a bq1 r1 0 r1 b b r1q2 r2 0 r2 r1 r1 r2q3 r3 0 r3 r2 . . rs3 rs2qs1 rs1 0 rs1 rs2 rs2 rs1qs 0 Then GCD(a,b) rs1. Section 4.3 Greatest Common Divisors (GCD) and Least Common Multiples (LCM) Definition: If a and b are natural numbers. The smallest natural number m that is a multiple of both a and b is called their least common multiple, written m LCM(a,b) . Finding the least common multiple from intersection of sets is useful when the numbers are small. Example: Find the least common multiple of 12 and 42. Find M12 { } and M 42 { }. Theorem: LCMs from Prime Power Representation a a Let a p11 p22... prar be the prime power representation b b of a and b p11 p22... prbr be the prime power c c representation of b. Then LCM(a,b) p11 p22... prcr where ck is the larger of ak and bk for 0 k r . Example: Find LCM(12,42) . Section 4.3 Greatest Common Divisors (GCD) and Least Common Multiples (LCM) Notice that 12 42 22 3 237 23 22 37 684 GCD(12,42) LCM(12,42) Theorem: If a and b are natural numbers ab GCD(a,b)LCM(a,b) . Example: Use the Euclidean algorithm and the fact that LCM(a,b) ab to find LCM(124,2940) . GCD(a,b)