
Chapter 4 - Number Theory and Cryptography 4.1 - Divisibility and Modular Arithmetic Definition 1 (Divisibility). Let a; b 2 Z with a 6= 0. We say that a divides b (write a j b) iff there exists c 2 Z such that b = ac. We write a - b if a does not divide b. Theorem 1. Let a; b; c 2 Z with a 6= 0. 1. If a j b and a j c then a j (b + c). 2. If a j b then a j bc. 3. If a j b and b j c then a j c. 4. If a j b and a j c then a j (mb + nc) for any m; n 2 Z. Theorem 2 (The Division Algorithm). Let a 2 Z and d 2 Z+. Then there exists unique q; r 2 Z such that 0 ≤ r < d and a = dq + r. d is called the divisor, a is called the dividend, q is called the quotient, and r is called the remainder. The book uses the following notation for the quotient and remainder: q = a div d; r = a mod d Example 1. 1 4.3 - Primes and Greatest Common Divisors Definition 2 (Prime). A prime is an integer such that if then either or . Theorem 3 (Fundamental Theorem of Arithmetic). Every positive integer > 1 is either a prime or can be expressed as a product of primes. This product of primes is up to . Definition 3. A composite integer is a positive integer > 1 which is not prime. Example 2. Proposition 1. An integer is divisible by 3 if and only if the sum of the digits in its decimal representation is divisible by 3. (This result is also true for 9.) Example 3. p Proposition 2. If n is composite then n has a prime divisor less than or equal to n. Prove that 197 is prime: 2 Theorem 4. There are infinitely many primes. Definition 4. Let a; b 2 Z+, not both 0. d 2 Z+ is said to be a common divisior of a and b iff dja and djb. d is the greatest common divisior of a and b iff 1. d is a common divisor of a and b, and 2. if e is any common divisor of a and b then e ≤ d. We use the following notation to denote GCDs: d = gcd(a; b) or d = (a; b). (We'll use the first one in this class to avoid confusion with points or open intervals.) Example 4. a = 12, b = 8. Definition 5. a; b 2 Z are said to be relatively prime iff gcd(a; b) = 1. a1; a2; : : : ; an are said to be pairwise relatively prime iff gcd(ai; aj) = 1 for any i 6= j. Example 5. a = 12, b = 11, c = 35. Definition 6. Let a; b 2 Z. m 2 Z is said to be a common multiple of a and b iff ajm and bjm. m is the least common multiple of a and b iff 1. m is a common multiple of a and b, and 2. if l is any common multiple of a and b then m ≤ l. We use the following notation to denote LCMs: m = lcm(a; b) or m = [a; b]. (We'll use the first one in this class to avoid confusion with closed intervals.) Example 6. a = 12, b = 8. 3 Finding GCDs and LCMs using the prime factorization Theorem 5. If a1 a2 an b1 b2 bn a = p1 p2 : : : pn and b = p1 p2 : : : pn where the pi are prime and ai; bj 2 N then min(a1;b1) min(a2;b2) min(an;bn) 1. gcd(a; b) = p1 p2 : : : pn max(a1;b1) max(a2;b2) max(an;bn) 2. lcm(a; b) = p1 p2 : : : pn Example 7. a = 61740 = 22 · 32 · 5 · 73, b = 1143450 = 2 · 33 · 52 · 7 · 112. Theorem 6. a · b = gcd(a; b)lcm(a; b) Theorem 7. Let a = bq + r. Then gcd(a; b) = gcd(b; r). Theorem 8 (Bezout's Theorem). Let a; b 2 Z+. Then there exists u; v 2 Z such that gcd(a; b) = au + bv. (We'll refer to the u and v as the `Bezout's coefficients’.) Corollary 9. gcd(a; b) = 1 iff there exists u; v 2 Z such that au + bv = 1. 4 The Extended Euclidean Algorithm (EEA) We use the following table to compute gcd's and find the Bezout's coefficients. (This algorithm assumes a > b.) i ri qi ui vi −1 a { 1 0 0 b { 0 1 1 r1 q1 u1 v1 2 r2 q2 u2 v2 . n rn qn un vn n + 1 0 qn+1 { { Table 1: EEA Table where ri−2 = ri−1qi + ri () ri = ri−2 − ri−1qi for i ≥ 1 with 0 ≤ ri < ri−1 (so ri is the remainder when the division algorithm is applied to ri−2 and ri−1) and ui = ui−2 − ui−1qi and vi = vi−2 − vi−1qi: We stop when we get a remainder of 0, and the last non-zero remainder, rn, is the GCD of a and b. At any line in the table ri = aui + bvi, so, in particular, un and vn are the Bezout's coefficients. Example 8. a = 1976 and b = 1251. i ri qi ui vi −1 1976 { 1 0 0 1251 { 0 1 1 2 3 4 5 6 7 8 9 0 { { Table 2: Example 8 5 Example 9. a = 81 and b = 64. (There may be extra rows in the table I've given you.) i ri qi ui vi −1 81 { 1 0 0 64 { 0 1 1 2 3 4 5 6 Table 3: Example 9 6.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-