MATH 470.502 Examination 1 Solutions October 14, 2014 1. Use the Euclidean Algorithm to find one solution of 851x + 1073y = gcd(851, 1073) with x, y ∈ Z. Show your work. Solution: First we apply the Euclidean Algorithm to calculate gcd(851, 1073): 1073 = 851 + 222 851 = 3 · 222 + 185 222 = 185 + 37 185 = 5 · 37 + 0. From this we see that gcd(851, 1073) = 37. We perform back-substitution to find x and y: 37 = 222 − 185 = 222 − (851 − 3 · 222) = 4 · 222 − 851 = 4(1073 − 851) − 851 = 4 · 1073 − 5 · 851. Therefore, x = −5 and y = 4 . 2. Calculate φ(540), where φ is Euler’s φ-function. Solution: First we need to factor 540 into prime powers: 540 = 22 · 33 · 5. Then using the multiplicativity of Euler’s φ-function, φ(540) = φ(22 )φ(33 )φ(5) = (4 − 2)(27 − 9)(5 − 1) = 2 · 18 · 4 = 144 . 3. Find all congruence classes of solutions modulo 57 of the following congruences. Be sure to show your work. (Finding the solutions by brute force checking all 57 cases will yield only 2 total points of credit.) (a) 5x ≡ 19 (mod 57) (b) 3x ≡ 19 (mod 57) Solution: (a) First, since gcd(5, 57) = 1, there is exactly one congruence class of solutions modulo 57. We need to calculate 5−1 modulo 57. To do this we see from the Euclidean Algorithm that 57 = 11 · 5 + 2, 1 5 = 2 · 2 + 1, and so 1 = 5 − 2 · 2 = 5 − 2(57 − 11 · 5) = 23 · 5 − 2 · 57. Therefore, 5−1 ≡ 23 (mod 57). From this we know we can multiply the original congruence through by 23 to obtain x: x ≡ 23 · 19 ≡ 437 (mod 57) ⇒ x ≡ 38 (mod 57) . (b) In this case gcd(3, 57) = 3. Since 3 - 19, we know that this implies that the congruence has no solutions . 4. Show that 2 is not a primitive root modulo 17. Explain. Solution: The goal is to show that the set of numbers {2k mod 17 | 1 ≤ k ≤ 16} is strictly contained in {1, 2, . . . , 16}. To do this we show that there are two different k1 , k2 such that 2k1 ≡ 2k2 (mod 17). After some calculation we see that 21 ≡ 2 (mod 17) and 29 ≡ 2 (mod 17). Therefore 2 is not a primitive root modulo 17. 5. We use the following alphabet: A B C D E F G 00 01 02 03 04 05 06 P Q R S T U V 15 16 17 18 19 20 21 H I J K L M 07 08 09 10 11 12 W X Y Z . ♥ 22 23 24 25 26 27 N O 13 14 ♣ 28 (a) Using the affine cipher x 7→ 5x + 17 (mod 29), encrypt the plaintext message GO into ciphertext. (b) Someone has sent you the message X♣ using the encryption key in part (a). What did they say? Solution: (a) After encryption we see that 6 7→ 47 ≡ 18 (mod 29) and 14 7→ 87 ≡ 0 (mod 29). Therefore the ciphertext is SA . (b) We first need to determine how to decrypt. To do this we see that if y ≡ 5x + 17 (mod 29), then x ≡ 5−1 (y − 17) (mod 29). We quickly see that 5−1 ≡ 6 (mod 29), and so the decryption function is y 7→ 6(y − 17) (mod 29). Then 23 7→ 36 ≡ 7 (mod 29) and 28 7→ 66 ≡ 8 (mod 29). Thus the plaintext is HI . 2 6. (a) Given that 761 is prime, use Fermat’s Little Theorem to simplify 88763 (mod 761). (b) Suppose we are given that 5003248 ≡ 2849 (mod 6497). Using this congruence, what can we conclude from Fermat’s Little Theorem about whether or not 6497 is prime? Explain. Solution: (a) By Fermat’s Little Theorem, we know that 88760 ≡ 1 (mod 761). Therefore, 88763 ≡ 88760 · 883 (mod 761) ≡ 1 · 883 (mod 761) ≡ 681472 (mod 761) ≡ 377 (mod 761). (b) The observation is that 6496 = 3248 · 2, and so 2 (mod 6497) 5006496 ≡ 5003248 2 ≡ 2849 (mod 6497) ≡ 8116801 (mod 6497) ≡ 2048 (mod 6497). If 6497 were prime, then Fermat’s Little Theorem would imply that 5006496 ≡ 1 (mod 6497). Since 2048 6≡ 1 (mod 6497), we can conclude that 6497 is not prime . 3