5-1 NUMBER THEORY: DIVISIBILITY; PRIME & COMPOSITE NUMBERS 210 f8 Note: Integers are the w hole numbers and their negatives (additive inverses). While our text discusses only w hole numbers, all these ideas extend to the negative integers as w ell as positive, so the statements can be inclusive. For all statements below , variables a, b, c, d, and k are w hole numbers (or integers).* Def' n: For k,b int egers k * b (k divides b) if, & only if, b = kc for some integer* c. If w e say k| b " k is a divisor or factor of b" " b is a multiple of k" equivalent statements “ b is divisible by k” If k is not a factor of b, w e say k does not divide b, and w rite k ' | b. for example 4| 20 because 20 = 5@4 A EG 3 * 12 (or 12 is a multiple of 3) 12 = 3@4 because 6 is a factor of 24 24 = 6@4 eg 4 ' | 17 Is 42 divisible by 3 ? 42 = 7@6 & 6 = 3@2 so 42 = 7@3@2 & 4 is a w hole num ber Fact: If a , W (or Z) Fact: then a* 0 because 0 = a @ 0 and 1 * a because a = 1 @ a and a* a because a = a @ 1 If d* a, then d* ab EG 150 must be divisible by 3, because 15 is.... Pf: if d* a then a = dc ab = (dc)b = d(cb), so ab is a multiple of d PQED Think: If 3| 15 then 15 = 3@5 Then 15@w must be 3@5@w So 15w must be a multiple of 3. Fact: If a* b and b* c then a* c (" divides" is transitive) a* b and b* c ÷ c = bm and b = an, for some m,n , Z [ by def' n of " * " ] bm = (an)m & (an)m = a(nm) [ assoc prop x ] so c = a(nm) and c = a(some integer) [ closure prop of mult.] ...thus proving that a* c PQED COMMENT: This is almost the same fact as above. E.G. Since 3| 15, and 15| 150, therefore 3| 150. Pf: Fact: If d* a and d* b, then d* (a+ b) and d* (a!b). Pf: If d* a and d* b, then a = dc and b = de , so a+ b = dc + de = d(c+ e) PQED The second follow s immediately from the first, since a!b = a + (!b). Put another w ay: if a and b are both multiples of d, then a+ b is also a multiple of d. For example: 7000 and 21 are both multiples of 7, therefore 7021 must be a multiple of 7. Fact: If d* a and d' | b, then d' | (a+ b). Pf: If d* a and d* (a+ b) then d must divide b since d* a ÷ d* !a so d* ((a+ b) + (!a)) and (a+ b) + (!a) = b. PQED Put another w ay: If a is a multiple of d, and b is not, then a+ b cannot be a multiple of d. For example: 90 is a multiple of 3, 2 is not. Therefore, 92 cannot be a multiple of 3. (We all know the multiples of 3 are spaced 3 units apart!!! ) ¸ Notice the tw o above facts together say: If d* a then d* (a+ b) iff d* b. ...That is: ® If d is already know n to divide a, then to see if d*(a+ b), just test w hether d*b . ® TESTS for DIV ISIBILITY One w ay to determine w hether a divides b is to attempt to divide b by a. How ever, there are a number of " tests" for divisibility by certain values. We are expected to know these. DIV ISIBILITY TEST FOR 2 : Is the units digit even? (i.e. is the units’ digit divisible by 2 )? This fact is often observed by children w ho learn to count by tw os. Eg. It is obvious to all of us that 3574 is divisible by 2 because 2 * 4. This shortcut w orks because 3574 = 3570 + 4. 4 is a multiple of 2, and 2 * 10 (so 2 * 357x10... ie 2 * 3570). In general, if u is t he unit s digit , and v represent s t he rest of t he v alue of a num ber, t hen t he num ber is ac t ually v + u and v is a m ult iple of 1 0 . Sinc e 2 *1 0 and 1 0 *v , w e know aut om at ically , w it hout inspect ing v , t hat 2 *v . If 2 also div ides u, t he unit s digit , t hen 2 *(v + u). On t he ot her hand, if 2 ' | u, since w e know 2 *v , 2 DIV ISIBILITY TEST FOR 5 : ...because of ' | (v + u). .. .because of ® ® Is the units digit 0 or 5? (i.e. is the units’ digit divisible by five)? This fact is genereally realized by children w ho learn to count by fives. Eg. That 31175 is divisible by 5 is obvious to anyone w ho has counted by fives. This shortcut w orks for the same reason that the test for divisibility by 2 w orks... because 31175 = 31170 + 5 and 31170 = 3117x10 and 5 * 10, so 5 * 31170. In general, if u represent s t he unit s digit , and v represent s t he rest of t he value of a num ber, t hen v is a m ult iple of 1 0 and t he num ber is v+ u. Sinc e 5 *1 0 and 1 0 *v , w e know aut om at ically , w it hout inspect ing v , t hat 5 *v . Thus 5 *(v + u) if and only if 5 *u. .. .because of 8 m ult iple of 1 0 ® 10: Is the units digit 0? (divisible by ten)? E.g. 34573 is obviously NOT divisible by 10. This w orks because 34573 = 34570 + 3 and 34570 = 3457 x 10 so 10 * 34570 but 10' | 3. DIV ISIBILITY TEST FOR In general, if t he unit s digit of a num ber is u, and v represent s t he rem aining value of a num ber, t hen t he ent ire v alue of t he num ber is v+ u (just as 3 4 5 7 3 = 3 4 5 7 0 + 3 ). v is a m ult iple of 1 0 . So w e need check only u (because of ). Sinc e 1 0 *v , 1 0 *(v + u) if f 1 0 *u. ® 4: Is the number represented by the two right-most digits divisible by four? E.g. 56712 is divisible by 4 since 4 * 12. 56718 is not divisible by 4 since 4 ' | 18. Why it w orks: 56712 = 56700 + . 56700 = 567 @ 100, and 4 * 100, so 4 * 56700 automatically. Since 4 also divides 12, 4 must divide 56700 + 12. Similarly , 56718 = 56700 + 18. Since 4 * 56700 and 4 ' | 18, it follow s that 4 ' | 56718. DIV ISIBILITY TEST FOR In general, if " t u" represent s t he num ber represent ed by t he t ens & unit s digit s, and v represent s t he rem aining v alue of a num ber, t hen t he num ber is v + " t u" and v is a m ult iple of 1 0 0 . Sinc e 1 0 0 is div isible by 4 , 4 *v . If 4 also div ides " t u" t hen 4 m ust div ide v + " t u" . (because of If 4 ' | " t u" t hen 4 cannot div ide v + " t u" . 8: check the last E.g. 56120 is divisible by 8 since 8 * DIV ISIBILITY TEST FOR This w ork s bec ause ... digits... . (because of ®) ®) 3 120 M ORE TESTS for DIV ISIBILITY 3: Is the SUM OF THE DIGITS divisible by three? Eg. 8652 is divisible by 3 since 8+ 6+ 5+ 2 = 21 and 21 is divisible by 3. This test w orks because 5622 = 8@10 3 + 6@10 2 + 5@10 + 2 = 8@(999 + 1) + 6(99 + 1) + 5@(9+ 1) + 2@1 = 8@999 + 8@1 + 6@99 + 6@1 + 5@9 + 5@1 + 2@1 = 8@999 + 6@99 + 5@9 + (8 + 6 + 5 + 2) DIV ISIBILITY TEST FOR ÆÉÉÉÈÉÉÇ ÆÉÈÉÇ Multiple of 9, thus of 3 21, a multiple of 3 In general: The v alue of eac h digit in a num eral (in our num erat ion sy st em ) is it s f ace v alue t im es a pow er of t en. But eac h pow er of t en is ex ac t ly 1 + (a m ult iple of nine). 3 *9 so 3 *(any m ult iple of 9 ). Thus 3 div ides t he giv en num ber if , and only if , 3 d iv ides t he sum of t he digit s, as seen in t he ex am ple abov e. The sam e argum ent dem onst rat es t he reason behind t he div isibilit y t est f or nine, w hich f ollow s.... 9: Is the SUM OF THE DIGITS divisible by nine? 9' | 8652 because the sum of the digits is 21, not a multiple of 9 9| 333 because 3+ 3+ 3 = 9 9| 6786 because 6+ 7+ 8+ 6 = 27, a multiple of 9. DIV ISIBILITY TEST FOR EG: This w ork s because... (see abov e). 11: Is the " A LTERNA TING SUM " OF THE DIGITS divisible by eleven? Eg. 562287 is divisible by 11 since 5!6+ 2!2+ 8!7 = 0 and 0 is divisible by 11* * * . This w orks because... 562287 = 5@10 5 + 6@10 4 + 2@10 3 + 2@10 2 + 8@10 + 7@10 0 5 4 3 2 = 5@(11 ! 1) + 6@(11 ! 1) + 2@(11 ! 1) + 2@(11 ! 1) + 8@(11 ! 1) + 7@(11 ! 1)0 = 5@(11j! 1) + 6@(11k+ 1) + 2@(11m ! 1) + 2@(11n+ 1) + 8@(11 ! 1) + 7@1 = 5@(11j) + 6@(11k) + 2@(11m) + 2@(11n) + 8@(11) + (! 5 + 6 ! 2 + 2 ! 8 + 7) DIV ISIBILITY TEST FOR As w e can see, 11 divides the first terms, so divisibility of 562287 by 11 depends on the divisibility of the last part! the “ alternating sum” of the digits, !5 + 6 !2 + 2 !8 + 7 . (Q: Do w e st art w it h + or ! ? A: Try bot h & see: 9 0 9 1 7 2 0 For t he f ollow ing, t hink of f act or t rees. Eg 36 4 2 D IV ISIBILIT Y " T EST " FOR D IV ISIBILIT Y T EST FOR True or false: 2 3 .... ) W hat num bers div ide (are f act ors of ) 3 6 ? 9 1, 2, 3, 4, 6, 9, 12, 18, 36 3 6: 12: If a number is divisible by 2 and by 9 , then it is divisible by 1 8 . (A) True or false: If a number is divisible by 3 and by 6 , then it is divisible by 1 8 . (B) (Statement A above is true. To see that Statement B is false, consider the number 6 . Or 1 2 . Or 2 4 . Or 3 0 . ) * * * As noted previously, if a is any w hole number (or any integer), then a| 0. ( because a @ 0 = 0 ) That is, 0 is a multiple of EVERY w hole number. Put another w ay: 0 belongs on the list of multiples of 2. ( @@@ , – 6, – 4, – 2, 0, 2, 4, 6, @@@ ) 0 belongs on the list of multiples of 3. ( @@@ , – 9, – 6, – 3, 0, 3, 6, 9, @@@ ) 0 belongs on the list of multiples of any w hole number a. ( @@@ , – 3a, – 2a, – a, 0, m, 2m, 3m, @@@ ) 5-3 PRIME NUMBERS Def' n: 210 f8 A PRIM E NUM BER is a natural number that has EX ACTLY TW O natural number divisors—1 & itself. A COM POSITE number is a natural number that has natural number divisors other than 1 and itself. Eg. 5 is a prime number, divisible by 1 and by 5, and no ot her elements of N. 6 is composite, since it is divisible by 2 and 3, in addition to 1 and 6. 1 is neither prime nor composite! ( 1 is called a UNIT . ) Prime or composite? 123 is (You can probably tell right aw ay, because 123 is clearly divisible by ... ) 223 is In testing w hether 223 is prime, must w e test for divisibility ...by 2? 3? 4? 5? 6? 7? 8? ...by 19? 2' | 223 because 3 is not even 3 ' | 223 because 2+ 2+ 3 = 7 Do w e need to test for divisibility by 4? No, if 223 w ere divisible by 4, it w ould be divisible by 2. 5' | 223 because ... Do w e need to test for divisibility by 6? No, if 223 w ere divisible by 6, it w ould be ... So w e need to test for divisibility by only primes only, right? 7' | 223 because 223 = 210 + 13 11 ' | 223 because 223 = 220 + 3 13 ' | 223 because 223 = 260 – 37 17 hmmm.... do w e have to test every prime up to 223? Well, it turns out NOT. We have to test only up to the square root of 223, w hich is less than 17, in fact less than 15. WHY?.... Consider the non-trivial* factor pairs of 72. 72 = 2@36 = 3@24 = 4@18 * Ev ery w hole num ber w is t he produc t of 1 & it self — w = 1 @w . = 6@12 This is called t he t riv ial f ac t orizat ion = 8@9 ...and w and 1 are called t riv ial f act ors. In this example n = 72. In the follow ing, think n= 72: If a is a factor of n, then n/a = c is a factor of n. That is: n = a@c. If a is greater than %& n , then c is smaller than %& n . (Eg 18 > %& 7& 2 , but then c = 3, much less than %& 7& 2 . Not both of a and c can be greater than %& n (if both > %& n , then a@c > %& n %& n a contradiction of the fact that n = a@c). So if n has any factors other than n and 1, there must be at least one # %& n. If none exist, then n has no factors other than the trivial factors, 1 and n and must be a prime. j To test whether a given number "n" is prime, test for divisibility by up to gTHERE A RE INFINITELY M A NY PRIM ES . [see text! It does a great job of show ing you that if you think you have them all, then there must be one more that is greater than any in your list... therefore, you can never have them all ! ] g A composite number may be expressed as a product of two or more non-trivial factors gFor any n, there exists a run of n consecutive composite numbers: Let m = 2@3@4@5@6@...@(n+ 1). Then m+ 2 is composite because 2 * m and 2 * 2; m+ 3 is composite because... Similarly, m+ k is composite for k = 2,3,4,...,n+ 1. PQED 5-3 More on PRIME NUMBERS 210 f8 g Reminder: A composite number may be expressed as a product of tw o or more non-trivial factors (t he trivial factors are 1 and the number itself). Such an expression is called a Eg. FA CTORIZA TION of the number. The composite number 12 may be expressed as 3@4... or as 3@6... or as 2@2@3 36 = 3@12 = 4@9 = ... = 6@6 = 2@18 = 2@2@3@3 = 2 2 @3 2 60 = 2@30 = ... = 2 2 @3@5 Intuitively w e can see that a composite number can be factored & if the factors are not all prime, they can be factored again... until the factors are all primes, no further factorization is possible: w e call this the PRIM E FA CTORIZA TION of the number. There is only one prime factorization of the number, as stated in the: g FUNDA M ENT A L THEOREM OF ARITHM ETIC : Every natural number > 1 has a unique prime factorization. g Ex am ple: Find t he prim e f act orizat ion of 1 3 2 . 132 = = = Tree: 2 @ 66 2 @ 2 @ 33 2@2@ @ 132 2 66 2 33 Find the prime factorizations of 240 336 131 Up for a challenge? Find n and m such that 8 n @ 9 3 @12 = 512@3 m 990 Think prime! Find the prime factorizations of these. (You might w ant to use a calculator to save some time.) 70,224 70,397 70001 5-5 GCF & LCM: Greatest Common Factor and Least Common Multiple 210 f8 If a natural number d divides every one of a set of integers, then d is a common factor or common divisor of those integers. Eg. 72 and 60 have common factors: 1, 2, 3, 4, 6, and 12. Eg. 22 and 27 have common factors: 1 Eg. 12, 30, and 75 have common factors: 1 and 3 gThe largest or maximum common factor of tw o w hole numbers is called the GREA TEST COM M ON FA CTOR, or GCF, of the numbers, called GCF(a,b) ...also called the greatest common divisor, or GCD. Eg. GCF( 72, 60) = 12 GCF( 22, 27) = 1 GCF( 12, 30, 75) = 3 If the GCF of tw o numbers is 1, the numbers are said to be relatively prime. Eg. 22 and 27 are relatively prime; they have no factors, other than 1, in common. Three Methods for obtaining GCF(a,b) M1. List the factors of the numbers: Eg. GCF(72,60) factors of 72: { 1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72} factors of 60: { 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60} Find the common factors: { 1, 2, 3, 4, 6, 12} Find the greatest: 12 Write the prime factorization of the numbers: 72 = 2 3 @3 2 60 = 2 2 @3@5 Build the largest possible factor of both by taking the low est pow er of each common prime factor: GCF( 72, 60) = GCF( 2 3 @3 2 , 2 2 @3@5) = 2 2 @3 = 12 Fill in t he Ex ponent s! M2. GCF( 336, 240, 990) = GCF( 2 4 3@7, 2 4 3@5, 2@3 2 5@11) = 2 3 5 7 11 = GCF( 5040, 960) = M3. GCF( , )= = Euclidean Algorithm Fact: For any a,b in N with a > mb for some m in N, GCF(a,b) = GCF(b,a!b) = GCF(b,a!mb). Pf: If d = GCF(a,b) then d* a and d* b, so d* (a!b) and d is in the set of common factors of a!b and b. Conversely, if d* (a!b) and d* b then d* ((a!b)+ b), that is d* a, so d is in the set of common factors of a and b. Thus the set of common factors of (a,b) and the set of common factors of (a!b,b) are identical. Induction on m , N extends this to GCF(a!mb,b). Notice that a ! mb is the remainder obtained by subtracting m " b' s" from a. So if mb is the largest multiple of b that is # a, then a ! mb must be the remainder obtained w hen a is divided by b. This implies that GCF(a,b) = GCF(r,b) w here r is the remainder obtained w hen a is divided by b ! Eg. GCF(30,12) = GCF(6,12) = 6 . Eg. GCF(72,30) = GCF(12,30) ... but GCF(30,12) = GCF(6,12) = 6... So GCF(72,30) = 6. We have just discovered the secret of the Euclidean algorithm for finding the GCF of tw o numbers: Divide and use the remainder.... Eg. GCF(676,182): 676 = 3@182 + 130 GCF(676,182) = GCF(182,130) What 182 = 1@130 + 52 GCF(182,130) = GCF(130,52) ¹ ...Why you do ¸ 130 = 2@52 + 26 GCF(130,52) = GCF(52,26) it w orks. 52 = 2@26 + 0 GCF(52,26) = 26 Note: To use the Euclidean algorithm for more than tw o numbers: find the GCF of any tw o; then find the GCF of that result w ith the next value, or w ith the GCF of another pair; etc. Each of the above methods (M1, M2, M3) has advantages. What is an advantage of each method? 5-5 GCF & LCM: Least Common Multiple 210 f8 gIf a natural number d is a multiple of every one of a particular set of integers, then d is a common multiple of those integers. The smallest or minimum common multiple of tw o w hole numbers is called the LEA ST COM M ON M ULTIPLE, or LCM, of the numbers, notated LCM(a,b,...). Eg. multiples of 12 = { 12, 24, 36, 48, 60, 72, 84, 96, 108, ... } multiples of 16 = { 16, 32, 48, 64, 80, 96, 112, 128, 144, ... } 12 and 16 have common multiples: { 48, 96, 144, ...} LCM( 12, 16) = 48 Eg. LCM( 12, 60 ) = 60 LCM( 24, 15 ) = 120 LCM( 6, 21, 10 ) = 210 Three Methods for obtaining LCM(a,b) M1. List the multiples of the numbers: Eg. LCM( 72, 60 ) multiples of 72: { 72, 144, 216, 288, 360, 432, 504, 576, ... } multiples of 60: { 60, 120, 180, 240, 300, 360, 420, 480, 540, ...} Find the common multiples: { 360, 720, 10800, ... } Find the least (common mulitple): 360 M2. Write the prime factorization of the numbers: 72 = 2 3 @3 2 60 = 2 2 @3@5 Build the least possible multiple of both by taking the highest pow er of each prime factor: LCM( 72, 60 ) = LCM( 2 3 @3 2 , 2 2 @3@5 ) = 2 3 @3 2 @5 = 360 LCM(12,14,30) = LCM( 2@2@3 , 2@7 , 2@3@5 ) = 2@2@3@5@7 = 420 Fill in t he Ex ponent s! LCM(18,60,54) = LCM( 2@3 2 , 2 2 @3@5 , 2@3 3 ) = 2 3 5 LCM(336,240,990) = LCM( 2 4 3 2 7 , 2 4 3@5 , 2@3 2 5@11 ) = 2 M3. = 3 5 Use the GCF Fact: For any a,b in N the product of their LCM & GCF is ab: 7 11 = GCF(a,b)@LCM(a,b) = ab. Pf : Relies on t he f ac t t hat if a prim e appears in t he f act orizat ion of a or b, t hen a = p r@m and b = p q@n and ab = p r@p q@m @n. GCF c ont ains p t o t he pow er m in(r,q) and LCM cont ains p t o t he pow er m ax (r, q). m in(r,q) + m ax (r,q) = r + q, t he pow er on p in t he f act orizat ion of ab. In short , all t he pow ers of prim es in t he f ac t orizat ions of a and b end up in eit her t he GCF or t he LCM .. . M ult iply ing t he t w o put s t hem alt oget her, rec onst it ut ing ab. Thus w e may use the Euclidean algorithm to find the LCM of tw o numbers, since Eg. LCM( 72, 60 ) = 72@60 / GCF(72,60) = LCM(a,b) = 72@60/12 = a@b GCF(a,b) 6@60 = 360 Eg. LCM( 676, 182 ) = Note: To find the LCM of more than tw o numbers via method (3), find the LCM of pairs, then find the LCM of the results (until every original number has been included). Something to think about! Giv en t he prim e f ac t orizat ion of a num ber, how can w e f ind t he num ber of f act ors of t he num ber? Here are som e quest ions t hat m ay lead t o an answ er: 8 = 23 W hat num bers div ide 8 ? How m any f act ors has 8 ? (A n s: f our: 1 , 2 , 4 , 8 ) W hat opt ions do y ou hav e w hen " building" a f act or of 8 ? (A n s: t hese f our: 2 0 , 2 1 , 2 2 , 2 3 ) 2 2 3 6 = 2 @2 @3 @3 = 2 @3 W hat num bers div ide 3 6 ? (2 ? 3 ? 5 ? 8 ?) W hat goes int o a f act or of 3 6 ; how can y ou " build" a f ac t or of 3 6 ? W hat c hoic es do y ou hav e t o m ake w hen building a f act or of 3 6 ? How m any f ac t ors of 3 6 ex ist in N? (A ns: 9 ) W rit e t he prim e f act orizat ion of 7 2 . W rit e t he prim e f act orizat ions of all t he f act ors of 7 2 (t hese w ere list ed on page 5 -5 ). W hat m ak es up t he f ac t ors of 7 2 ? How m any dif f erent w ay s can you build a num ber w hich div ides 7 2 ? (If y ou are " building" a f act or of 7 2 , can y ou use 5 ? [no] ...can y ou use 2 ? 4 ? 8 ? 1 6 ? no 2 ' s at all? . .. .