Mathematics 312, Solutions to Review Problems for Midterm 2 November 2015. Instructor: Z. Reichstein. Problem 1: Is the 10-digit integer n := 2222222222 divisible by (a) 3? (b) 5? (c) 9? (d) 11? Solution: (a) Modulo 3, n is congruent to the sum of its digits. That is, n ≡ 2 · 10 ≡ 20 6≡ 0 (mod 3). Hence n is not divisible by 3. (b) Since n is not divisible by 3, it is not divisible by 9. (c) Modulo 11, n is congruent to the alternating sum of its digits. Thus, n ≡ 2 − 2 + ··· + 2 − 2 ≡ 0 (mod 11). Answer: n is divisible by 11. (d) Modulo 101, 102 ≡ −1. Thus n ≡ 22 · 22 · 102 + · · · + 22 · 108 ≡ 22 − 22 + 22 − 22 + 22 ≡ 22 6≡ 0 (mod 101) . Answer: n is not divisible by 101. Problem 2: Find the last three decimal digits of 7999 . Solution: Finding the last three decimal digits of 7999 amounts to computing 7999 (mod 1000) . I claim that 7100 ≡ 1 (1) (mod 1000) . 23 ·53 Note that 1000 = = 8·125. By the Chinese Remainder Theorem, in order to prove (1) it suffices to show that (a) 7100 ≡ 1 (mod 8) and (b) 7100 ≡ 1 (mod 125). Since φ(8) = φ(23 ) = 4 and φ(125) = φ(53 ) = 4 · 52 = 100, (a) and (b) follow from Euler’s Theorem. This completes the proof of the congruence (1). Now note that 7 · 7999 ≡ 71000 ≡ (7100 )10 ≡ 110 ≡ 1 (mod 1000). Thus 7999 ≡ 7−1 (mod 1000) . 7−1 To compute (mod 1000), recall that 7 · 11 · 13 = 1001. Thus the inverse of 7, modulo 1000 is 11 · 13 = 143. In conclusion, 7999 ≡ 7−1 ≡ 143 (mod 1000) and thus the last three decimal digits of 7999 are 143. Problem 3: Denote the integer 32760 = 23 · 32 · 5 · 7 · 13 by m. Prove that if gcd(a, m) = 1, then a12 ≡ 1 (mod m). Solution: By the Chinese Remainder Theorem it suffices to show that (i) a12 ≡ 1 (mod 23 ), (ii) a12 ≡ 1 (mod 32 ), (iii) a12 ≡ 1 (mod 5), and (iv) a12 ≡ 1 (mod 7), and (iv) a12 ≡ 1 (mod 13). By Euler’s Theorem, 3 aφ(2 ) ≡ a4 ≡ 1 (mod 23 ), 2) aφ(3 ≡ a6 ≡ 1 (mod 32 ), aφ(5) ≡ a4 ≡ 1 (mod 5), aφ(7) ≡ a6 ≡ 1 (mod 7), aφ(13) ≡ a12 ≡ 1 (mod 13), and (i) - (v) follow. Problem 4: Suppose n = p7 q 3 r5 , where p, q and r are distinct primes. How many positive divisors does n have? What is the sum of these divisors? What is φ(n), where φ is the Euler φ-function. Solution: Use the formulas for the multiplicative functions τ (n), σ(n) and φ(n) in Sections 7.1 and 7.2. Number of positive divisors: τ (n) = τ (p7 q 3 r5 ) = (7 + 1)(3 + 1)(5 + 1) = 8 · 4 · 6 = 192. p8 − 1 q 4 − 1 r6 − 1 Sum of positive divisors: σ(n) = · · p−1 q−1 r−1 Euler φ-function: φ(n) = (p − 1)p7 (q − 1)q 2 (r − 1)r4 . Problem 5: Prove that the number of positive divisors of n ≥ 1 is odd if and only if n is a complete square. Solution: Let n = pd11 · . . . · pdr r be the prime decomposition of n. The number of positive divisors σ(n) = (d1 + 1) . . . (pr + 1) is odd if and only if every factor di + 1 is odd. On the other hand, every di + 1 is odd if and only if d1 , . . . , dr are all even. Finally, d1 , . . . , dr are all even if and only if n is a complete square. Problem 6: Show that n = pi is not a perfect number for any prime p and any positive integer i. pi+1 − 1 Solution: σ(n) = is not divisible by p; hence, cannot be equal to 2n. p−1 Problem 7: Recall that an affine cryptosystem, with encryption key KE = (26, a, b) and decryption key KD = (26, c, d) works as follows. Each letter is assigned a numerical value, in alphabetical order: A 7→ 0, B 7→ 1, . . ., Z 7→ 25. These numbers are then viewed modulo 26 and are encrypted by the formula x 7→ y = ax + b (mod 26) and decrypted by the formula y 7→ cy + d (mod 26) . It is known that the most frequently occurring letter in the English language is E (with numerical value 4) and the second most frequently occurring letter is T (with numerical value 19). Suppose these letters are encoded as F (numerical value 5) and G (numerical value 6), respectively. (a) Find the encryption key KE . (b) Find the decryption key KD . Solution: (a) Since 4 is enciphered as 5 and 19 as 6, a and b satisfy the following system of congruences: 4a + b = 5 (mod 26) 19a + b ≡ 6 (mod 26) Subtracting the first congruence from the second, we obtain 15a ≡ 1 (mod 26). To find a ≡ 15−1 (mod 26), we use the Euclidean algorithm to compute gcd(26, 15): 26 = 15 + 11 15 = 11 + 4 11 = 2 · 4 + 3 4=3+1 Now use back substitution: 1 = 4−3 = 4−(11−2·4) = −11+3·4 = −11+3·(15−11) = 3·15−4·11 = 3·15−4·(26−15) = 7·15−4·26 . Thus 7 · 15 ≡ 1 (mod 26), and a ≡ 7 (mod 26). From the first congruence, b ≡ 5 − 4a ≡ 5 − 4 · 7 ≡ 3 (mod 26) . Thus KE = (26, a, b) = (26, 7, 3). (b) c ≡ a−1 ≡ 15 (mod 26), and d ≡ −a−1 b ≡ (−15) · 3 ≡ 7. Thus KD = (26, c, d) = (26, 15, 7) . Let us check that with this key we will, indeed, decipher 5 as 4 and 6 as 19. Indeed, 5 · 15 + 7 ≡ 4 (mod 26) and 6 · 15 + 7 ≡ 15 + (5 · 15 + 7) ≡ 15 + 4 ≡ 19 (mod 26).