Docsity

Math 110A Homework #2: Primes and Congruences, Assignments of Algebra

Toggle sidebar
bg1
Math 110A Homework #2
David Wihr Taylor
Summer 2006
1. Problem 1.3.1: Express each number as the product of primes: (a)5040, (b) −2345, (c) 45670,
(d) 2042040.
Answer: To my knowledge there is no fast algorithm to factor primes that doesn’t use quantum
computing (see Shore’s algorithm if you want to see how to factor on a quantum computer). If
there were some conventional algorithm, then all computer encryption would be unsafe (same
thing if anyone ever builds a quantum computer)! However, there is an algorithm that runs
as a polynomial function of the size of the number you input that tells you if your number is
prime. All this basically doesn’t help you do this problem, but it’s interesting stuff anyway.
Mathematica tells me:
(a) 5040 = 24·32·5·7
(b) −2345 = −1·5·7·67
(c) 45670 = 2 ·5·4567
(d) 2042040 = 22·3·5·11 ·13 ·17.
2. Problem 1.3.9:
Claim. If pis prime and (a, b) = pthen (a2, b2) = p2
Proof. First we notice that if pdivides both aand bthen p2divides both a2and b2. Now let’s
express aand bby their prime factorizations a=pr1
1···prk
kand b=qs1
1···qsl
l. Then since
(a, b) = pwe know that for one and only one pair (i, j ) does pi=qj=pand furthermore
ri=sj= 1. That is, the only common factor of aand bis p, otherwise we could just multiply
some other common factor by pto get a bigger common factor! Then since a2=p2r1
1···p2rk
k
and b2=q2s1
1···q2sl
l, (a2, b2) is only divisible by common factors of aand b. The only common
factor of aand bis p. Thus if c= (a2, b2) then p|c. Now from the above prime factorizations
we see that the biggest power of pthat divides both a2and b2is p2. Thus p2= (a2, b2).
3. Problem 1.3.20:
(a) Prove that there are no integers aand bsuch that a2= 2b2.
(b) Prove that √2 is irrational
Proof. (a) Let a=pr1
1···prk
kand b=qs1
1···qsl
lbe prime factorizations of aand b. Then
a2=p2r1
1···p2rk
kand b2=q2s1
1···q2sl
lare prime factorizations of aand b. Then for some i,
p2ri
i= 2. This implies that pi= 2 and 2ri= 1. This is a contradiction since rimust be an
integer!
(b) If √2 is rational then √2 = a/b for some integers aand b. Then 2 = a2/b2which implies
that a2= 2b2. By part (a) we know this cannot happen. Therefore √2 is irrational.
1
pf2

Partial preview of the text

Download Math 110A Homework #2: Primes and Congruences and more Assignments Algebra in PDF only on Docsity!

Math 110A Homework

David Wihr Taylor

Summer 2006

  1. Problem 1.3.1: Express each number as the product of primes: (a)5040, (b) −2345, (c) 45670, (d) 2042040. Answer: To my knowledge there is no fast algorithm to factor primes that doesn’t use quantum computing (see Shore’s algorithm if you want to see how to factor on a quantum computer). If there were some conventional algorithm, then all computer encryption would be unsafe (same thing if anyone ever builds a quantum computer)! However, there is an algorithm that runs as a polynomial function of the size of the number you input that tells you if your number is prime. All this basically doesn’t help you do this problem, but it’s interesting stuff anyway. Mathematica tells me:

(a) 5040 = 2^4 · 32 · 5 · 7 (b) −2345 = − 1 · 5 · 7 · 67 (c) 45670 = 2 · 5 · 4567 (d) 2042040 = 2^2 · 3 · 5 · 11 · 13 · 17.

  1. Problem 1.3.9:

Claim. If p is prime and (a, b) = p then (a^2 , b^2 ) = p^2

Proof. First we notice that if p divides both a and b then p^2 divides both a^2 and b^2. Now let’s express a and b by their prime factorizations a = pr 11 · · · pr kk and b = q 1 s 1 · · · q ls l. Then since (a, b) = p we know that for one and only one pair (i, j) does pi = qj = p and furthermore ri = sj = 1. That is, the only common factor of a and b is p, otherwise we could just multiply some other common factor by p to get a bigger common factor! Then since a^2 = p^21 r 1 · · · p^2 krk and b^2 = q^21 s 1 · · · q^2 l sl, (a^2 , b^2 ) is only divisible by common factors of a and b. The only common factor of a and b is p. Thus if c = (a^2 , b^2 ) then p|c. Now from the above prime factorizations we see that the biggest power of p that divides both a^2 and b^2 is p^2. Thus p^2 = (a^2 , b^2 ).

  1. Problem 1.3.20:

(a) Prove that there are no integers a and b such that a^2 = 2b^2. (b) Prove that

2 is irrational

Proof. (a) Let a = pr 11 · · · pr kk and b = qs 11 · · · qs l l be prime factorizations of a and b. Then a^2 = p^21 r 1 · · · p^2 kr kand b^2 = q^21 s 1 · · · q^2 l slare prime factorizations of a and b. Then for some i, p^2 i ri= 2. This implies that pi = 2 and 2ri = 1. This is a contradiction since ri must be an integer! (b) If

2 is rational then

2 = a/b for some integers a and b. Then 2 = a^2 /b^2 which implies that a^2 = 2b^2. By part (a) we know this cannot happen. Therefore

2 is irrational.

  1. Problem 1.3.23:

(Euclid) Prove that there are infinitely many primes.

Proof. We proceed by contradiction: Assume that there are finitely many primes which we list: p 1 ,... , pk. Then consider the product n = p 1 · · · pk + 1. Then n has remainder 1 when divided by each prime, and so must either be prime itself or a product of primes not on our list. This is a contradiction since we assumed our list had all the primes.

  1. Problem 2.1.1: If a = b (mod n) and k | n, is it true that a = b (mod k)?

Yes! a = b (mod n) implies that a = b + l · n. Then k | n implies that n = q · k. Therefore a = b + l · q · k, and we obtain the equality, a = b (mod k).

  1. Problem 2.1.9: Prove that

(a) (n − a)^2 = a^2 (mod n) (b) (2n − a)^2 = a^2 (mod 4n)

Proof. (a) (n − a)^2 = n^2 − 2 an + a^2. Therefore, the remainder mod n is a^2. (b) (2n − a)^2 = 4n^2 − 4 an + a^2. Therefore, the remainder mod 4n is a^2.

  1. Problem 2.1.16:

(a) If a is a nonnegative integer, prove that a is congruent to its last digit mod 10. (b) Show that no perfect square has 2,3,7, or 8 as its last digit.

Proof. (a) Let a have the base-ten representation a =

∑n i=0 ai^ ·^10

i (^) where ai ∈ Z and 0 ≤ ai ≤ 9. Then a ≡ a 0 (mod 10). This is what we wanted to show. (b) a^2 = (

∑n i=0 ai^ ·^10

i) (^2) = (∑n i=1 ai^ ·^10

i (^) + a 0 ) (^2) = (∑n i=1 ai^ ·^10

i) (^2) + 2(∑n i=1 ai^ ·^10

i)a 0 + a 2

Then a^2 ≡ a^20 (mod 10). So we only need classify the remainders of a^20 modulo 10 to finish. 02 = 0, 12 = 1, 22 = 4, 32 = 9, 42 = 16, 52 = 25, 62 = 36, 72 = 49, 82 = 64, 92 = 81 so the only possibe remainders are 0, 1 , 4 , 5 , 6 and 9. Then a perfect square can’t have last digit 2 , 3 , 7 , or 8.

  1. Problem 2.1.17:

Prove that a ≡ b (mod n if and only if a and b have the same remainder mod n.

Proof. First let’s use division with remainder to write a = q 1 n + r 1 and b = q 2 n + r 2. If a ≡ b (modn) then we know that (a − b) = (q 1 − q 2 )n + (r 1 − r 2 ) = l · n. Then we have that r 1 − r 2 = (l + q 2 − q 1 )n. Then we know r 1 ≡ r 2 (mod n). But since 0 ≤ r 1 , r 2 < n, we must have r 1 − r 2 = 0. Thus r 1 = r 2. Conversely, assume a = q 1 · n + r and b = q 2 · n + r, that is they have the same remainder when divided by n. Then a − b = (q 1 − q 2 )n, which means that a ≡ b (mod n).