Mathematics 312, Section 101. Final Exam Solutions

advertisement
Mathematics 312, Section 101. Final Exam Solutions
December 17, 2010. Instructor: Z. Reichstein.
Problem 1. Let n be an integer. Show that there does not exist a prime number p ≥ 2
which divides both 8n + 3 and 5n + 2.
Solution: Recall that gcd(a, b) = gcd(b, a − qb) for any integer q. Using this repeatedly
(with q = 1 and q = 2), we obtain
gcd(8n+3, 5n+2) = gcd(5n+2, 3n+1) = gcd(3n+1, 2n+1) = gcd(2n+1, n) = gcd(n, 1) = 1.
Problem 2. Let n = 3100 and a = 8585 . . . 85 be the 2n-digit number, where the digits 85
repeat n times.
(a) Is a divisible by 9?
(b) Is a divisible by 11?
Explain your answers.
Solution: (a) Modulo 9, a is congruent to the sum of its digits.
a ≡ 3100 (8 + 5) = 9 · 398 (8 + 5) ≡ 0
(mod 9) .
(b) Modulo 11, a is congruent to the altenrating sum of its digits. Note that by Fermat’s
theorem, 310 ≡ 1 (mod 11) and thus 3100 ≡ (310 )10 ≡ 1 (mod 11). Thus
a ≡ 3100 (−8 + 5) = 1 · (−8 + 5) ≡ −3 ≡ 8
(mod 11) .
Problem 3. Find all three-digit combinations that can occur as the last three digits of
a100 , where a ranges over the integers. Give a simple criterion for predicting which of these
possibilities occurs for a given a, without computing a100 . Prove that your criterion is
correct.
Hint: Investigate a100 modulo 8 and modulo 125 separately, then use the Chinese Remainder Theorem.
Solution: To find the last three digits of a100 , we reduce a100 modulo 1000 = 8 · 125,
following the hint.
a100 modulo 125. If a is divisible by 5, then a100 is divisible by 5100 and, in particular,
100
a
≡ 0 (mod 125) (Check!). On the other hand, since φ(125) = φ(53 ) = 4 · 52 = 100,
Euler’s theorem tells us that if a is not divisible by 5, then a100 ≡ 1 (mod 125).
a100 modulo 8. Similarly, if a is divisible by 2, then a100 is divisible by 2100 , and, in
particular, a100 ≡ 0 (mod 8). If a is not divisible by 2, then by Euler’s Theorem, a4 ≡ 1
(mod 8) and thus a100 ≡ 1 (mod 125). In summary, there are four possibilities.
Case 1. a is divisible by both 2 and 5, i.e., a is divisible by 10. In this case
a100 ≡ 0 (mod 125) and
a100 ≡ 0 (mod 8).
By the Chinese Remainder Theorem, a ≡ 0 (mod 1000). The last 3 digits of a1000 are
000.
Case 2. a is divisible by 2 but not by 5. Then
a100 ≡ 1 (mod 125) and
a100 ≡ 0 (mod 8).
By the Chinese Remainder Theorem a ≡ 8y1 · 1 + 125 · y2 · 0 ≡ 8y1 (mod 1000), where
y1 := 8−1 (mod 125), and y2 := 125−1 (mod 8).
Here we can take (y1 , y2 ) to be an integer solution to
(1)
8y1 + 125y2 = 1.
We only need y1 in Case 2, but we will need y2 in Case 3. Thus we will digress at this
point, and recall how to find an integer solution to the linear equation (1), by performing
the Euclidean algorithm on 8 and 125, followed by back substitution.
Euclidean algorithm:
125 = 15 · 8 + 5
8=1·5+3
5=1·3+2
3 = 1 · 2 + 1.
Back substitution: 1 = 3 − 2 = 3 − (5 − 3) = 2 · 3 − 5 = 2 · (8 − 5) − 5 = 2 · 8 − 3 · 5 =
2 · 8 − 3(125 − 15 · 8) = 47 · 8 − 3 · 125.
Thus we have found an integer solution to the linear diophantian equation (1), namely
(y1 , y2 ) = (47, −3).
We are now in a position to complete our analysis in Case 2:
a100 ≡ 8y1 ≡ 8 · 47 ≡ 376
(mod 1000).
a100
The last two digits of
are 376.
Case 3. a is divisible by 5 but not by 2. Then
a100 ≡ 1 (mod 125) and
a100 ≡ 0 (mod 8).
By the Chinese Remainder Theorem,
a100 ≡ 8 · y1 · 0 + 1 · 125 · y2 ≡ 125y2 ≡ 125 · (−3) ≡ −375 ≡ 625
(mod 1000).
The last three digits of a100 are 625.
Case 4. a is not divisible by either 2 or 5. Then
a100 ≡ 1 (mod 125),
a100 ≡ 1 (mod 8).
and thus, by the Chinese Remainder Theorem, a100 ≡ 1 (mod 1000). The last three digits
of a100 are 001.
Problem 4. Suppose a positive integer n has 77 positive divisors (1 and n count among
them). How many of these divisors can be primes? Explain your answer.
Solution: Suppose n has r distinct prime divisors, p1 , . . . , pr . That is, n = pd11 · · · pdr r ,
where d1 , . . . , dr ≥ 1. Let us arrange them so that d1 ≤ d2 ≤ · · · ≤ dr .
Then the number of positive divisors of n is
(d1 + 1) · . . . · (dr + 1) = 77 .
Note that each factor di + 1 is ≥ 2. Since 77 = 7 · 11 is a product of two distinct primes,
there are only two possibilities: either there is only one factor in the above product, i.e.,
r = 1 and d1 = 76, or there are two factors, d1 = 6 and d2 = 10. Thus r = 1 or r = 2, i.e.,
n has either one or two prime divisors.
Problem 5. Find all positive integers n such that φ(n) = 22 and prove that there are no
others. Here φ denotes the Euler φ-function.
Solution: First note that n cannot be divisible by more than one odd prime; otherwise
φ(n) is divisible by 4. (Check!) Also, n cannot be divisible by 4p, where p is an odd prime,
because if it is, then, once again, φ(n) is divisible by 4. (Check.) This leaves us with the
following possibilities for n:
(i) n = pd , (ii) n = 2pd , and (iii) n = 2d , for d ≥ 0.
Here p denotes and odd prime.
In Case (iii), φ(n) is a power of 2, so cannot be 22.
In Cases (i) and (ii), φ(n) = (p − 1)pd−1 . What can the odd prime p be here?
If p > 23, then φ(n) ≥ p − 1 > 22, a contradiction.
On the other hand, if p < 23, then φ(n) = (p − 1)pd−1 is not divisible by 11 (check!), so
φ(n) cannot be 22.
Thus, the only possibility for p in cases (i) and (ii) is p = 23, and the only possibility for
d is d = 1. The final answer is n = 23 or 46.
Problem 6. 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; they are encrypted by the formula
x −→ y ≡ ax + b (mod 26)
and decrypted by the formula
y −→ x ≡ 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).
Problem 7. Suppose the public key for an RSA cryptosystem is (n, e) = (85, 7) and the
secret key is (85, d). Show that this cryptosystem is not secure by finding d.
Remarks: Recall that a message x is encoded by x −→ xe (mod n) and a received
message y is decoded by y −→ y d (mod n). To make this cryptosystem secure, one needs
to use a much larger n.
Solution: The system is not secure, because we can factor 85:
85 = 5 · 17 .
Now we can compute φ(85) = 4 · 16 = 64. The decryption key is the inverse of e = 7
modulo 64. Since 7 · 9 ≡ 63 ≡ −1 (mod 64), we see that 7−1 ≡ −9 ≡ 55 (mod 64). Thus
the decryption key d is 55.
Problem 8. Prove that the congruence x5 ≡ 1 (mod 52579) has exactly one solution,
x ≡ 1 (mod 52579). Use the fact that 52579 is a prime. What other property of 52579 is
used in your proof?
Solution: Choose a primitive root r, modulo 52579. Then x5 ≡ 1 (mod 52579) is
equivalent to
(2)
5 · indr (x) ≡ 0
(mod 52578).
Since gcd(5, 52579) = 1, 5 is invertible, (mod 52578). Multiplying both sides by 5−1
(mod 52578), we obtain indr (x) ≡ 0 (mod 52578). In other words, x ≡ 1 (mod 52579) is
the only solution to the original congruence.
The above argument relies on the following properties of p = 52578:
(i) There is a primitive root modulo p.
(ii) 5 is invertible modulo p − 1. In other words, p − 1 is not divisible by 5 or equivalently,
p 6≡ 1 (mod 5).
As we showed in class, every prime p has property (i). On the other hand, not every
prime has property (ii). For example, p = 11 or p = 31 do not share this property.
Download