Mathematics 312, Midterm 2 solutions November 16, 2015. Instructor: Z. Reichstein. Problem 1: (5 marks) Suppose x is a 10-digit integer and y is obtained from x by writing the same digits in reverse order. For example, x = 9876543210 then y = 0123456789 or equivalently 123456789 (if one or more zeros appear in front, we simply ignore them). (a) Is x − y always divisible by 9, for any choice of x? (b) Is x − y always divisible by 11, for any choice of x? In each part, give a proof if the answer is “yes” and a counterexample if the answer is “no”. Solution: (a) The sum of the digits is the same for x and y; denote it by s. We know that modulo 9, every positive integer is congruent to the sum of its digits. Thus x−y ≡s−s≡0 (mod 9). In other words, x − y is divisible by 9. (b) Let us say x = (a9 . . . a0 )10 . Reversing the digits, we obtain y = (a0 . . . a9 )10 . We know that x ≡ a0 − a1 + · · · + a8 − a9 (mod 11) and y ≡ a9 − a8 + · · · + a1 − a0 ≡ −x (mod 11). Thus x − y ≡ x − (−x) ≡ 2x (mod 11). For example, if x = 1000000000 and y = 1, then x ≡ −1 (mod 11), y ≡ 1 (mod 11). Thus x − y ≡ −1 − 1 ≡ −2 6= 0 (mod 11), and in particular, x − y is not divisible by 11. Problem 2: (5 marks) Recall that a composite integer n is called a Carmichael number if bn−1 ≡ 1 (mod n) for any integer b such that gcd(b, n) = 1. Prove that 1729 = 7 · 13 · 19 is a Carmichael number. Solution: Let n = 1729. By the Chinese remainder Theorem, it suffices to show that (i) bn−1 ≡ 1 (mod 7), (ii) bn−1 ≡ 1 (mod 13), and (iii) bn−1 ≡ 1 (mod 19), for any integer b such that gcd(b, n) = 1 (or equivalently, for any integer b which is not divisible by 7, 13 or 19). By Fermat’s Little Theorem, (a) b6 ≡ 1 (mod 7), (b) b12 ≡ 1 (mod 13), and (c) b18 ≡ 1 (mod 19). Since n − 1 = 1728 is divisible by 4 (look at the last two digits) and by 9 (because the digit sum, 1 + 7 + 2 + 8 = 18, is divisible by 9), n − 1 is divisible by 36 and hence, by 6, 12 and 18. (i), (ii) and (iii) now follow from (a), (b) and (c), respectively. Problem 3: (5 marks) Find all positive integers n such that τ (2n) = 2 τ (n). Explain your answer. Here τ (n) denotes the number of positive divisors of n. Solution: Write n = 2a m, where m is odd. Then τ (n) = τ (2a )τ (m) = (a + 1)τ (m) and τ (2n) = τ (2a+1 )τ (m) = (a + 2)τ (m) . Thus τ (2n) = 2τ (n) translates into (a + 1)τ (m) = 2aτ (m) . Here τ (m) is a positive integer. After dividing both sides by τ (m), we obtain a+2 = 2(a+1) or equivalently, a + 2 = 2a + 2. The only solution to this equation is a = 0. Answer: τ (2n) = 2τ (n) if and only if n is odd. Problem 4: (5 marks) Recall that an affine cryptosystem, with encryption key KE = (26, a, b) works as follows. Each letter is assigned a numerical value, in alphabetical order: A has numerical value 0, B numerical value 1, . . ., Z has numerical value 25. These numbers are then viewed modulo 26 and are enciphered via the enciphering transformation x 7→ ax + b (mod 26) . A transformation of the above form is a legitimate (i.e., one-to-one and onto) enciphering transformation if and only if gcd(a, 26) = 1. We say that a letter with numerical value x is “fixed” if x is enciphered as x. Is it possible to choose the enciphering key KE = (26, a, b), with gcd(a, 26) = 1, so that there is (a) exactly one fixed letter? (b) exactly two fixed letters? (c) exactly three fixed letters? (d) exactly four fixed letters? (e) exactly 13 fixed letters? In each part, give a proof if the answer is “no” and an example, if the answer is “yes”. Solution: Fixed letters with numerical value x are solutions to the congruence ax+b ≡ x (mod 26) or equivalently, to the congruence (a − 1)x ≡ b (mod 26) . We know that, depending on the choice of b, a congruence of this form either has no solutions or has exactly gcd(a − 1, 26) solutions. The only values that can possibly be assumed by gcd(a − 1, 26) are 1, 2, 13 or 26. Note, however, that our requirement that gcd(a, 26) = 1 forces a to be odd. Thus a − 1 is even, and gcd(a − 1, 26) has to be divisible by 2. This means that we cannot have exactly 1, 3, 4 or 13 fixed letters, so the answer is “no” in parts (a), (c), (d), and (e). In part (b) the answer is “yes”. For example, if we take a = 3 and b = 0, the fixed letters will be solutions to 2x ≡ 0 (mod 26). This congruence has exactly gcd(2, 26) = 2 solutions, x ≡ 0 and 13 (mod 26).