140 likes | 228 Views
From the last time: gcd( a , b ) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers. It is the positive common divisor of a and b which is divisible by every common divisor. .
E N D
From the last time: • gcd(a, b) can be characterized in two different ways: • It is the least positive value of ax + by where x and y range over • integers. • It is the positive common divisor of a and b which is divisible by • every common divisor.
Consider now positive integers Z+ = {1, 2, 3, …}. • Any positive integer n >1 has at least two dividers, 1 and n . • An integer p >1, that does not have any other dividers except • 1 and itself, is called a prime. • An integer n >1, that is not a prime, is composite. • Theorem. Any composite integer n Z+ has a prime factor. Proof by contradiction. Assume there exists some positive integer, that has no prime factors. Then the set of such integers S and we can find the smallest element n S Z+. Since n is composite, n = k m, with 1< k, m < n, so k, m S , so they are eitherprimes or have prime factors. In either case n has a prime factor.
The first primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, … • Does this sequence has an end? This question is not as trivial as it seems! • Theorem (Euclid) There are infinitely many primes. Proof. Suppose there were only a finite number of primes p1, p2, …pk. Then form a number n = p1p2 … pk +1=2357… pk +1. n is not divisible by 2, for then both n and 2357… pk would be divisible by 2, and therefore their difference would be divisible by 2. This difference is 1, and is not divisible by 2. In the same way, n is not divisible by 3 or by 5 or … or pk. But n is either a prime or has a prime factor. In any case it is divisible by some prime p that is not among the list 2, 3, 5,…pk. It implies that there is a prime distinct from 2, 3, 5…pk, and so greater then pk. Consequently, the list of primes can never end.
Fundamental Theorem of Arithmetic. Any integer n > 1 can be written as a product of prime numbers. Further, this product is unique except for rearrangement of factors. For example, take number 666. It is not a prime, because it has a factor 2, so we get 666=2333. Now 333 has an obvious factor 3, so 333=2111. Again 111 has a factor 3, and 111=337, hence: 666=23337 is a representation of the composite number 666 as a product of primes. Other examples: 12=223=223; 120 = 22235=23 3 5; But is there any another representation of 666 as a product of primes (we don’t distinguish different orders of factors)?
Proof that a prime factorization exists for any integer n >1. Prove by strong induction on n >1. Basis.n =2 is prime itself, so the proposition is true. Inductive Hypothesis. Assume that for some k >1 there exists prime factorization for all integers 1<nk. Inductive Step Consider n=k+1. We can have two cases: either n is a prime, or n is composite. In the first case we have nothing to prove. In the second case n = m1 m2 and 1< m1, m2 <n. By IH both m1, m2 have prime factorization, so n has a prime factorization as well.
If p | a we are done, so consider the case p | a Lemma 1. If a prime p divides the product of two numbers, p | ab, it must divide at least one of them. Proof. Assume p | ab to prove that p | a or p | b. gcd(p, a)=1 What can be implied about gcd(p, a)? Then the only common factor of p and a is 1. It implies that there exist integers x0and y0 such that p x0+ay0=1 Then b =b(px0+ay0) = p (b x0)+(ba) y0 is divisible by p because bothp(b x0) and (ba) y0 are divisible by p. Suppose now that some number c divides the product ab, c | ab. Can we imply that c divides either a or b ?
Proof of the uniqueness of the prime factorization Prove it by contradiction. For this assume that there exists some integer that has non-unique prime factorization. By Well-Ordering Principle we can find the smallest such integer, let it be n. So we have n =p1 p2…pk = q1 q2… qs , where all pi, qj are primes.
Note that p1 divides q1(q2… qs), so it either divides q1 or (q2… qs). If p1| q1 then p1= q1 , both are primes. If p1| (q2… qs), we repeat the argument, and ultimately reach the conclusion, that p1 equals one of the primes q1,q2,… qs . Then we can cancel the common prime from the two representations and find another integer n/p1 <n that has non-unique prime factorization in contradiction with assumption, that n is the smallest one.
Suppose that the prime factorizations of the integers a and b are: (ai, bi 0 ) where all primes occurring in either factorization are included in both factorizations with zero exponent if necessary. Then The least common multiple of two integers: Now we can find another form for gcd(a, b). • This integer does divide both a and b. • No larger integer can divide both a and b.
Lemma. For any two integers x and y we have: x + y = max(x, y)+min(x, y) Theorem. For any two integers a and b ab= gcd (a, b) lcm(a, b)
The same value can be found from Euclid Algorithm as follows: 500 = 1204 + 20 120 =206 So, the last nonzero remainder is 20. Example. Find gcd(120, 500) using prime factorization. We have 120=23 3 5 and 500=22 53 , then gcd(120, 500)= 2min(3, 2) 3min(1, 0) 5min(1, 3) =22 30 51=20. What is the lcm(120, 500)? 120500 = 60,000 = gcd(120, 500) lcm(120, 500) =20 lcm(120, 500) lcm(120,500)= 3000
Theorem. If n is a composite integer, it has a prime factor less than or equal to Proof.If n is composite, it has a factor a with 0<a<n. Hence, n = ab, where both a and b are positive integers greater then 1. So, either a or b , since otherwise ab > Hence, n has a divisor less or equal . It may be either prime or composite, but in any case n has a prime factor less or equal . The contrapositive of this theorem: If an integer n does not have a prime factor less or equal to , then n is prime. Given an integer n how can we decide is it a prime or not? How many factors we need to check? Obviously we don’t need to check factors above n. But there exists better restriction.
Sieve of Eratosthenes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 We need to consider only primes less or equal 10: 2, 3, 5, 7
The only primes not exceeding are : 2, 3, 5, 7. So we check that 101 is not divisible by 2, not divisible by 3, by 5 and by 7. So, 101 is prime. Example. Show that 101 is a prime.