Math 780 Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 55

Math 780: Elementary Number Theory

(Instructor's Notes)* What Is It?:


Elementary Number Theory is the study of numbers, and in particular the study of the set of positive integers. Does \elementary" mean \easy"? No. Example. Consider a positive integer m < 105 , and view it as a four digit number (with possible leading digit 0). Suppose all four digits are distinct. Let k be the number obtained by putting the digits of m in increasing order, and let ` be the number obtained by putting the digits in decreasing order. Let m = k ; `. Now repeat the process with m in place of m. Continue. What happens? How can this be explained?
0 0

Rational and Irrational Numbers:


De ne them. Give typical proof. Theorem 2. An irrational number to an irrational power can be rational.

Theorem 1. 2 is irrational.
p
p

Proof: Consider 2 and 2 . Theorem 3. e is irrational. Proof: Assume e = a=b with a and b positive integers, and set
() Then 0< <
b b! X b! X : = b!e ; j ! = j ! j =0 j =b+1
1

X
1

1 =1 j b j =1 (b + 1)

1:

On the other hand, the middle expression in ( ) is an integer. Hence, we have a contradiction and e is irrational. Open Problem. Is e irrational? X 1 Open Problem. Is n 5 irrational? n=1
1

*These notes are from a course taught by Michael Filaseta in the Fall of 1997.

(1) Let I = ; denote the set of irrational numbers. Determine whether each of the following is true or false. If it is true, simply state so. If it is false, state so and give a counterexample. (a) 2 I and 2 I implies + 2 I (b) 2 I and 2 I implies 2 I (c) 2 ; f0g and 2 I implies + 2 I and 2 I (d) 2 I and 2 ; f0g implies 2 I (e) 2 ; f1g and 2 I implies 2 I p (2) Prove that n is irrational wheneverp n is a positive integer which is not a square. Give an argument similar to that given for 2. Clarify where you feel we are using certain properties of the integers that we should have perhaps discussed rst. p p (3) Prove that 2 + 3 is irrational. p p p (4) Prove that 2 + 3 + 5 is irrational. (5) Prove that log2 3 is irrational. (6) Prove that e2 is irrational using an argument similar to that given above for e.
R Q Q Q Q

Homework:

Divisibility Basics:

De nition. Let a and b be integers. Then a divides b (or a is a divisor of b or b is divisible by a) if there is an integer c such that b = ac. Notation. We write ajb if a divides b, and we write a b if a does not divide b. De nition. An integer p is prime (or is a prime) if it is > 1 and divisible by no other positive integer other than 1 and itself. (In Algebra, the condition that p be > 1 is replaced by jpj > 1.) The division algorithm. Theorem 4. If a 6= 0 and b are any integers, then there exist unique integers q (called the quotient) and r (called the remainder) with 0 r < jaj such that b = qa + r. Proof. Let r be the least non-negative integer in the double sequence
-

: : : b ; 2a b ; a b b + a b + 2a : : : :
Let q be such that b ; qa = r. Since (b ; qa) ; jaj is in the double sequence and < b ; qa, we have (b ; qa) ; jaj < 0. Thus, r < jaj. Also, r 0. This proves the existence of q and r as in the theorem. For j 2 f1 2g, suppose qj and rj are integers such that b = qj a + rj and 0 rj < jaj. Then () (q1 ; q2 )a ; (r1 ; r2 ) = 0: This implies aj(r1 ; r2 ). On the other hand, r1 ; r2 2 (;jaj jaj). Hence, r1 = r2 . Now, ( ) implies q1 = q2 , establishing the uniqueness of q and r as in the theorem.

De nition and Notation. Let n and m be integers with at least one non-zero. The greatest common divisor of n and m is the greatest integer dividing both n and m. We denote it by gcd(n m) or (n m). Note that if n is a non-zero integer, then (0 n) = jnj. Theorem 5. If a and b are integers with at least one non-zero, then there exist integers x0 and y0 such that ax0 + by0 = (a b). Moreover,
fax + by

:x y2
Z

g = fk (a

b) : k 2

g:

Proof. Let S = fax + by : x y 2 g. Let d denote the smallest positive integer in S . Let x0 and y0 be integers for which d = ax0 + by0 . Theorem 5 follows from the following claims. Claim 1. fkd : k 2 g S . Reason: Clear. Claim 2. S fkd : k 2 g. Reason: Let u = ax + by 2 S . By Theorem 4, we have integers q and r with u = dq + r and 0 r < d. On the other hand,
Z Z
0 0

r = u ; dq = (ax + by ) ; (ax0 + by0 )q = a(x


0 0

; x0 q ) + b(y 0 ; y0 q ) 2 S:

It follows that r = 0 and u = qd. Claim 3. dja and djb. Reason: Use Claim 2 together with a 2 S and b 2 S . Claim 4. d = (a b). Reason: Since ax0 + by0 = d, (a b)jd so that (a b) d. Since dja and djb, d is a common divisor of a and b. By the de nition of greatest common divisor, d = (a b).

The Fundamental Theorem of Arithmetic (Unique Factorization): Theorem 6. Every integer n > 1 can be written uniquely as a product of primes in
the form

pe rr where p1 < p2 < < pr are distinct primes and e1 e2 : : : er and r are positive integers. Comment: In other words, every positive integer n can be written uniquely as a product of primes except for the order in which the prime factors occur. Lemma. If p is a prime and a and b are integers such that pjab, then either pja or pjb. Proof of Lemma. Let k be an integer such that ab = kp, and suppose p a. We wish to show pjb. By Theorem 5, there are integers x and y such that ax + py = 1. Hence, b = abx + pby = p(kx + by). Thus, pjb.
-

1 e2 n = pe 1 p2

The case n = 2 is clear. Suppose it is true for n less than some integer m > 2. If m is prime, then m is a product of primes. If m is not prime, then m = ab with a and b integers in (1 m). Since a and b are products of primes by the induction hypothesis, so is m. Now, we prove uniqueness by induction. Again, one checks n = 2 directly. Suppose uniqueness of the representation of n as a product of primes as in the theorem holds for n < m. Let p1 : : : pr (not necessarily distinct) and q1 : : : qt (not necessarily distinct) denote primes such that m = p1 pr = q1 qt . Observe that p1 jq1 qt . Hence, the lemma implies p1 jq1 or p1 jq2 qt . This in turn implies p1 jq1 , p2 jq2 , or p1 jq3 qt . Continuing, we deduce that p1 jqj for some j 2 f1 2 : : : tg. As p1 and qj are primes, we obtain p1 = qj . Now, p2 pr = m=p1 = q1 qj 1 qj +1 qt and the induction hypothesis imply that the primes p2 : : : pr are the same as the primes q1 : : : qj 1 qj +1 : : : qt in some order. This implies the theorem.
; ;

Proof of Theorem 6. First, we prove that n is a product of primes by induction.

(1) Let a, b, c, and d denote positive integers. Prove each of the following: (a) ajb and bjc implies ajc (b) acjbc implies ajb (c) ajb and cjd implies acjbd (2) Prove that if n is anpinteger 2 which is composite (i.e., not prime), then n has a prime divisor which is n. (3) Let S = flog10 p : p primeg. Prove that the elements of S are linearly independent over the rationals. (This is an example of an in nite set of real numbers which is linearly independent over .) (4) Observe that n4 + 4n is prime if n = 1. Prove that n4 + 4n is composite if n is an integer > 1.
Q

Homework:

Euclidean Algorithm:

Review. In grade school, we learned to compute the greatest common divisor of two numbers by factoring the numbers. For example, (77 119) = (7 11 7 17) = 7. Now, try (3073531 304313) this way. What's the moral? Theorem 7. (The Euclidean Algorithm) Let a and b be positive integers. Set r0 = a and r1 = b. De ne r2 r3 : : : rn+1 and n by the equations

. . . rn 2 = rn 1 qn 1 + rn rn 1 = rn qn + rn+1
; ; ; ;

r0 = r1 q1 + r2 r1 = r2 q2 + r3

with 0 < r2 < r1 with 0 < r3 < r2 . . . with 0 < rn < rn 1 with rn+1 = 0
;

where each qj and rj is in . Then (a b) = rn .


Z

Back to examples. Compute (3073531 304313) this way. Not to be misleading, compute (2117 3219) using the Euclidean Algorithm. Proof: Let d = (a b). Then one obtains djrj for 0 j n +1 inductively, and hence djrn . Thus, d rn (since rn > 0). Similarly, one obtains rn divides rn j for 1 j n. It follows that rn is a divisor of a and b. By the de nition of (a b), we deduce rn = (a b). Solutions to ax + by = m. From Theorem 5, we need only consider m = k(a b). One can nd solutions when k = 1 by making use of the Euclidean Algorithm (backwards). Show how the complete set of solutions for general m can be obtained from this. Also, mention the connection with the simple continued fraction for a=b. Example. Solve 3219x + 2117y = 29. The solutions are the (x y) of the form
;

x = 25 ; t 2117 29

and y = ;38 + t 3219 29

for t 2 :
Z

Theorem 8. Let a and b be positive integers. The Euclidean Algorithm for calculating (a b) takes 2( log2 b] + 1) steps (i.e, divisions). Proof: Let s = log2 b] + 1. In the notation of Theorem 7, we want n 2s. Assume n 2s + 1. We show rst that rj +2 < rj =2 for j 2 f1 2 : : : n ; 2g. If rj +1 rj =2, then rj +2 < rj +1 rj =2. If rj +1 > rj =2, then rj = rj +1 qj +1 + rj +2 where qj +1 = 1. Hence, in this case, rj +2 = rj ; rj +1 < rj =2. Hence, in either case, rj +2 < rj =2. We deduce that
r1 = b : 2s 2s Therefore, s < log2 b. This contradicts that s = log 2 b] + 1 > log2 b.
; ; ;

1 rn < rn2 2 < rn4 4 <

< rn2s2s

Homework:

(1) For each of the following, calculate (a b) and nd a pair of integers x and y for which ax + by = (a b). (a) a = 289 and b = 1003 (b) a = 3569 and b = 1333 (2) Find the complete set of integer solutions in x and y to 821x + 1997y = 24047:

Modulo Arithmetic:

De nition. Two integers a and b are congruent modulo an integer n if nj(a ; b). Notation. a b (mod n). Examples. What will be the time 1000 hours from now? On what day of the week will September 3 be in 1998?

b (mod n) and b c (mod n), then a c (mod n). b (mod n) and c d (mod n), then a + c b + d (mod n). b (mod n) and c d (mod n), then ac bd (mod n). b (mod n) and djn, then a b (mod d). Proof: Give the obvious proofs. In particular, in (iii), observe that a ; b = kn and c ; d = `n for some integers k and ` so that ac ; bd = (a ; b)c + (c ; d)b = (kc + `b)n
and the result follows. Comment: Note that (iii) implies that if a b (mod n) and k is a positive integer, then ak bk (mod n). Theorem 10. Let m be a positive integer, and let a be an integer relatively prime to m. Then there is an integer x for which ax 1 (mod m). Proof: Use that there are integers x and y such that ax + my = 1. Comments: The x in Theorem 10 is called the inverse of a modulo m. It is unique modulo m since (a m) = 1 and ax ay mod m implies x y (mod m). Also, note that if (a m) 6= 1, then a does not have an inverse modulo m (since ax ; 1 = mk would be impossible). (1) Explain the usual tests for divisibility by each of 2, 3, 4, 5, 6, 9, and 11. (2) What is the last digit of 71000 ? 23 (3) Determine the last digits of the numbers in the sequence 23 2323 23(23 ) : : : . (4) Is 3752743877345287574827904870128487127731 a sum of two squares? n (5) Let Fn = 2(2 ) + 1 (the nth Fermat number). Explain why 641jF5 . Use that 641 = 24 + 54 and 641 = 5 27 + 1. Comments: A regular n-gon is constructible with straight-edge and compass if and only if n = 2k p1 pr 3 where k and r are non-negative integers and p1 : : : pr are distinct Fermat primes. The only known Fermat primes are Fn for 0 n 4 (i.e., 3, 5, 17, 257, and 65537), and it is believed that these are the only Fermat primes.

(i) If a (ii) If a (iii) If a (iv) If a

Theorem 9. Let a, b, c, and n be integers. Then each of the following holds.

Examples.

Homework:

(1) Prove that if n 7 (mod 8) then n is not a sum of 3 squares. (2) Prove that for every non-constant polynomial f (x) with integer coe cients, there is an integer m such that f (m) is composite. (3) A large furniture store sells 6 kinds of dining room suites, whose prices are $231, $273, $429, $600.60, $1001, and $1501.50, respectively. Once a South American buyer came, purchased some suites, paid the total amount due, $13519.90, and sailed for South America. The manager lost the duplicate bill of sale and had no other memorandum of each kind of suite purchased. Help him by determining the exact number of suites of

each kind the South American buyer bought. (Don't forget to show that your solution is unique.) (4) Find (with proof) the smallest integer > 1 dividing at least one number in the sequence 31 331 3331 33331 : : : .

Fermat's Little Theorem: Theorem 11. For any prime p and any integer a, ap ; a is divisible by p. Comments: In other words, with p and a as above, ap a (mod p). The theorem
is equivalent to: if p is a prime and a is an integer with (a p) = 1 (in other words, with p not dividing a), then ap 1 1 (mod p). Proof 1: Use induction. The theorem holds with a = 1. If it holds for a, then
;

p X p (a + 1) = j =0

p aj ap + 1 a + 1 (mod p): j

This proves the theorem for positive integers. Since every integer is congruent to a positive integer modulo p, the result follows. Proof 2: Again, we may suppose a > 0. Fix a colors. The number of necklaces with p beads, each bead colored with one of the a colors (allowing repetitions), having at least two beads colored di erently is (ap ; a)=p. Here, we count necklaces as distinct if one cannot be obtained from the other by a rotation (we don't allow ipping necklaces over). Thus, (ap ; a)=p 2 , and the result follows. Fermat's Little Theorem can be used for determining that a given integer N is composite as follows: (i) Check N for small prime factors (this Pk stepj isn't necessary but is reasonable). (ii) Write N in base 2, say N = j =0 j 2 with j 2 f0 1g for each j and k = log N= log 2] + 1. (iii) Compute 22j (mod N ) by squaring. (iv) Calculate m 2 f0 1 : : : N ; 1g such that
Z

k Y j =0

2 j2

2N (mod N ):

(v) If m 6= 2, then N is composite. Otherwise the test is inconclusive. Comments: The algorithm works for establishing that \most" composite numbers are composite (i.e., for most composite numbers, m 6= 2). If m = 2, then one can check if 3N 3 (mod N ). Note that the algorithm takes on the order of log N steps so that the algorithm is a polynomial time algorithm (it runs in time that is polynomial in the length of the input - elaborate on this). There are no polynomial time algorithms that determine conclusively whether an arbitrary integer is composite.

De nitions. A pseudo-prime is a composite number n > 1 satisfying 2n 2 (mod n). A probable prime is an integer n > 1 satisfying 2n 2 (mod n). (Explain the reasons behind these de nitions.) Examples. Explain why 341 = 11 31 is a pseudo-prime. Explain why Fn = 22n +1 is a probable prime. (Note that for n > 5, Fn is really probably not a prime.) De nition. An absolute pseudo-prime (or a Carmichael number) is a composite number n > 1 such that an a (mod n) for every integer a. Example. Explain why 561 = 3 11 17 is an absolute pseudo-prime. Comment: Alford, Granville, and Pomerance have shown that there exist in nitely many absolute pseudo-primes. The much easier result that there exist in nitely many pseudo-primes is in the next list of homework problems.

Euler's Theorem:

De nition and Notation. For a positive integer n, we de ne (n) to be the number of positive integers n which are relatively prime to n. The function is called Euler's -function. Examples. (1) = 1, (2) = 1, (3) = 2, (4) = 2, (p) = p ; 1 for every prime p, and (pq) = (p ; 1)(q ; 1) for all primes p and q Theorem 12. For every positive integer n and every integer a relatively prime to n, we have a (n) 1 (mod n). Proof: If n = 1, the result is clear. We suppose as we may then that n > 1. Let a1 a2 : : : a (n) be the (n) positive integers n relatively prime to n. Consider the numbers

a1 a a2 a : : : a (n) a: Note that no two numbers in ( ) are congruent modulo n since (a n) = 1 and ai a aj a (mod n) implies ai aj (mod n) so that i = j . Now, x j 2 f1 2 : : : (n)g. There are integers q and r such that aj a = nq + r and 0 r < n. Since (aj a n) = 1 and n > 1, we obtain r 6= 0 and (r n) = 1. Thus, r = ak for some k 2 f1 2 : : : (n)g. Hence, for each j 2 f1 2 : : : (n)g, there is a k 2 f1 2 : : : (n)g for which aj a ak (mod n). Since the numbers aj a are distinct modulo n, we deduce that the numbers in ( ) are precisely a1 a2 : : : a (n) in some order. Therefore,
()

a1 a2
Since gcd(a1 a2

a (n) (a1 a)(a2 a) (a (n) a) a (n)a1 a2 a (n) (mod n): a (n) n) = 1, we obtain a (n) 1 (mod n) as desired.

Wilson's Theorem: Theorem 13. For every prime p, (p ; 1)! ;1 (mod p). Proof: If p = 2, the result is clear. We consider now the case p > 2. Let S =
f1

2 : : : p ; 1g. For every a 2 S , there is a unique a

S satisfying a a
0

1 (mod p).

If a = 1 or a = p ; 1, then a = a. The converse statement also holds since a = a implies (a ; 1)(a + 1) = a2 ; 1 is divisible by p so that a 1 (mod p) or a p ; 1 (mod p). The remaining elements of S can be grouped in (p ; 3)=2 pairs (a a ), say (a1 a1 ) : : : (a(p 3)=2 a(p 3)=2 ), so that (p ; 1)! 1 (p ; 1) (a1 a1 ) (a(p 3)=2 a(p 3)=2 ) 1 (p ; 1) ;1 (mod p):
0 0 0 0 ; 0 ; 0 0 ; ;

(4) below).

Comment: The converse of Wilson's Theorem also holds (see homework problem

Homework:

(1) Prove that 1105 and 1729 are absolute pseudo-primes. (2) Prove that if n is a pseudo-prime, then 2n ; 1 is a pseudo-prime. (Note that this implies that there are in nitely many pseudo-primes.) (3) Find the smallest positive integer k such that ak 1 (mod 756) for every integer a which is relatively prime to 756. (4) Prove the converse of Wilson's Theorem. More speci cally, prove that if n is an integer > 1 for which (n ; 1)! ;1 (mod n) then n is a prime. (5) Let p and d be integers with p > 1 and d > 0: Prove that p and p + d are both prime if and only if 1 + (;1)d d! + 1 + 1 (p ; 1)! p p+d p p+d is an integer.

Public-Key Encryption: Example. The following information is made public:

If someone wishes to send me, Jim, a message, use the following. Let N = 49601 and s = 247. As your alphabet use 00 for a blank, 01 for \a", 02 for \b", 03 for \c", etc. (Eg. \No" would be represented \1415".) Suppose your message is M . Let

E M s (mod N )
where 0 E < N . Then M is your actual message, and E is the encrypted message. Publish E in the personals tomorrow, and I alone will know your actual message M .

Note: To do this properly, one needs N to be considerably larger. Here, only two letter words can actually be sent (though a combination of two letter words including blanks can make for a sentence). The secret. The number N is a product of two large primes (su ciently large so only Jim knows how N factors). In the example above, N = 193 257. Since Jim knows how N factors, he can also compute (N ). In this case, (N ) = (193 257) = 192 256 = 49152:

10

Using the Euclidean algorithm, for example, Jim also knows a positive integer t such that

st 1 (mod (N )):
Here, t = 199. Thus, Jim (and only Jim) can calculate

E t M st M k (N )+1 M (mod N ):
In other words, Jim can gure out M given the value of E . Comment: This approach makes for a good public-key encryption scheme because the value of (N ) cannot seemingly be computed without the knowledge of how N factors. To clarify, it is possible to compute (N ) without having the factorization of N , but the fastest known methods at the time for computing (N ) when N is large involve rst factoring N . Further example. Someone has sent the encrypted message E = 48791 to Jim. What should he do (assuming he wants to know what the message says)? Note that

t = 199 = 27 + 26 + 22 + 2 + 1:
By squaring, he computes

E E2 E 22 E 23 E 24 E 25 E 26 E 27
Hence,

48791 11287 21001 39510 47029 18251 28286 33666

(mod N ) (mod N ) (mod N ) (mod N ) (mod N ) (mod N ) (mod N ) (mod N ):

M E t E 27 E 26 E 22 E 2 E 1 (33666)(28286)(21001)(11287)(48791) 809 (mod N ):


The message sent was, \Hi".

Homework:

(1) Someone wants to send Jim the message, \No". Compute the encrypted message E and then verify your work by decoding E . (Show your work using steps similar to that shown above.)

11

Certi ed Signatures:
The problem. Jim has two friends, Brian and Jason. Jim just got an encrypted message E in the personals. I won't specify what E was because it might upset Jim (since you can now decode Jim's messages because you too know how N factors). The message to Jim in the personals read:
Jim, I really like your idea for having secret messages sent to you so that no one else can know what's being said in the personals besides you. In fact, I liked it so much that I thought I would send you a quick note to let you know what I think of you. Here it is: E . Sincerely, Brian.

In the above message, E is actually some number. The problem is that when Jim decoded E , he was not very happy about what Brian had to say (and you wouldn't be either if you happened to be the one the message E was intended for). As a consequence, Jim and Brian never talked to each other again, and Jim's best friend became Jason. What Jim never did gure out though was that Jason actually wrote the message. Solution. One can sign a message simply by adding ones name to the end of a message M and then encrypting the whole message, name and all. Unfortunately, this is precisely what Jason did he added Brian's name to the end of the message sent to Jim. When Jim read it, he actually thought that Brian must have sent it since no one else could possibly have encrypted Brian's name. He never realized that actually anyone could encrypt Brian's name. There is however a proper way to certify a signature in an encrypted message. Let's suppose that Brian and Jason also decided to use the same encrypting scheme as Jim. In particular, Brian has some number N that he alone knows how to factor and some number s , both of which he makes public. And suppose he has computed t (his secret exponent for decoding messages sent to him) satisfying s t 1 (mod (N )). Note that S = 0218090114 represents Brian's name. Brian computes the value of T S t (mod N ) with 0 T < N . Since t is only known to Brian, T is something only Brian knows. If Brian wants to truly sign a message to Jim (so that Jim knows it is from him) he now simply adds T to the end of his message and then encrypts the entire message (with T ). When Jim receives the message, he decodes it. To verify the message is from Brian, he takes the value of the signature T given at the end of the message and computes T s modulo N (note that both s and N are known to him). Since s t 1 (mod (N )), Jim obtains S this way (i.e., S T s (mod N )). He then sees that the message is from Brian. The main point is that since t is only known to Brian, he alone could have computed the value of T given at the end of the message to Jim. The rest of the story. Actually, Brian did have numbers N and s that he made public, and Jason had such numbers as well. Jason sent a friendly message to Brian which Jason signed with a certi ed signature. Brian responded with a message containing his own certi ed signature. It was then that Jason sent his message to Jim. At that point, Brian had given Jason the value of T (Brian's certi ed signature), so Jason used Brian's certi ed signature in his message to Jim. So how might this problem be avoided? (Discuss possible answers.)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

12

The Chinese Remainder Theorem: Theorem 14. Let m1 : : : mk be pairwise relatively prime positive integers. Let
b1 : : : bk be arbitrary integers. Then the system
. . .

x b1 (mod m1 ) x bk (mod mk )
has a unique solution modulo m1 mk . Proof (Constructive): Let M = m1 mk . For j 2 f1 2 : : : kg, de ne Mj = M=mj . If i and j are in f1 2 : : : kg with i 6= j , then (mi mj ) = 1. It follows that for each j 2 f1 2 : : : kg, (Mj mj ) = 1 so that there is an Mj 2 such that
0

Mj Mj 1 (mod mj ):
0

P We set x = k j =1 bj Mj Mj . Then
0

x bj Mj Mj bj (mod mj )
0

for j 2 f1 2 : : : kg:

This proves the existence of a solution to the system of congruences in the statement of the theorem. For uniqueness, suppose that y also satis es y bj (mod mj ) for each j 2 f1 2 : : : kg. Then y ; x 0 (mod mj ) for each such j , and we deduce that each mj divides y ; x. As the mj are relatively prime, we obtain M j(y ; x). In other words, y x (mod m1 mk ). (1) Solve 17x 3 (mod 210) by using the Chinese Remainder Theorem. Use that 210 = 2 3 5 7 and observe that solving 17x 3 (mod 210) is equivalent to solving the system x 1 (mod 2), x 0 (mod 3), x ;1 (mod 5), and x 1 (mod 7). The latter is equivalent to x 1 (mod 14) and x 9 (mod 15). Therefore,

Examples.

x 1 15 1 + 9 14 (;1)

;111

99 (mod 210):

(2) If a and b are integers, then the point (a b) is called a lattice point. A visible lattice point is one for which gcd(a b) = 1 (it is visible from the origin). Prove that there are circles (or squares) in the plane which are arbitrarily large and have the property that each lattice point in the circles (or squares) is not visible. (Use that there are in nitely many primes.) (3) Prove that there exists a positive integer k for which 2n k + 1 is composite for all positive integers n. (It is known that k = 78557 has this property and it is an open problem to determine whether or not 78557 is the smallest such k.) We use the Fermat

13

numbers Fn = 22n + 1. Recall that Fn is prime for 0 n 4 and F5 is composite with 641 a \proper" divisor. Explain the following implications:

n n n n n n n

1 (mod 2) 2 (mod 4) 4 (mod 8) 8 (mod 16) 16 (mod 32) 32 (mod 64) 0 (mod 64)

=) =) =) =) =) =) =)

2n k + 1 2n k + 1 2n k + 1 2n k + 1 2n k + 1 2n k + 1 2n k + 1

0 0 0 0 0 0 0

(mod 3) (mod 5) (mod 17) (mod 257) (mod 65537) (mod 641) (mod F5 =641)

provided provided provided provided provided provided provided

k k k k k k k

1 1 1 1 1 1

(mod 3) (mod 5) (mod 17) (mod 257) (mod 65537) (mod 641) ;1 (mod F5 =641):

By the Chinese Remainder Theorem, there are in nitely many positive integers k satisfying the conditions on k on the right above (note that the last modulus is relatively prime to the others). Also, every integer n can be seen to satisfy at least one of the congruences involving n on the left. It follows that there are in nitely many positive integers k such that for every positive integer n, the number 2n k + 1 is divisible by one of 3, 5, 17, 257, 65537, 641, and F5 =641. If k is su ciently large with this property, then it will su ce for a value of k for this example Comments: If every integer n satis es at least one of a set of congruences x aj (mod mj ), for j = 1 : : : k, then the congruences are said to form a covering of the integers. It is unkown whether or not there is a covering consisting of distinct odd moduli > 1. Also, it is not known whether or not there is a constant C > 0 such that every covering using distinct moduli contains a modulus < C .

Homework:

(1) Find the smallest positive integer n > 2 such that 2 divides n, 3 divides n + 1, 4 divides n + 2, 5 divides n + 3, and 6 divides n + 4. Prove your answer is the least such n. (2) A squarefree number is a positive integer n which is not divisible by a square > 1. For example, 1, 2, 3, 5, and 6 are squarefree but 4, 8, 9, and 12 are not. Let k be an arbitrary positive integer. Prove that there is a positive integer m such that m + 1 m + 2 : : : m + k are each NOT squarefree. (Use that there are in nitely many primes.) (3) Calculate the remainder when the number 123456789101112 : : : 19781979 is divided by 1980. (4) Let a0 = a and a1 = b be positive integers, and let an+1 = 2an + an 1 for all positive integers n. Find relatively prime a and b such that every an , with n 0, is composite. (Hint: I used the system of congruences n 0 (mod 2), n 1 (mod 3), n 3 (mod 4), n 5 (mod 6), and n 9 (mod 12). You should convince yourselves that this system forms a covering of the integers. The idea is to make each an divisible by a prime where the prime depends on which of these congruences n satis es. For example, suppose I choose a and b so that a 1 (mod 3) and b ;1 (mod 3). Then for n satis ng n 3 (mod 4), which is one of the congruences in the system above, we will have that an is divisible by
;

14

3. To see this consider the sequence an modulo 3 keeping in mind that a 1 (mod 3) and b ;1 (mod 3). The main problem should be guring out what primes to use.)

Euler's Phi Function Revisited:

Recall (n) is the number of positive integers n that are relatively prime to n. Lemma 1. For every prime p and every positive integer k, (pk ) = pk ; pk 1 . Proof. The number of multiples of p which are pk is pk 1 . The result follows. Lemma 2. For relatively prime positive integers m and n, (mn) = (m) (n). Proof. If m = 1 or n = 1, then the result is clear so we suppose m > 1 and n > 1. Let a1 : : : a (m) denote the positive integers m which are relatively prime to m, and let b1 : : : b (n) denote the positive integers n which are relatively prime to n. Suppose now that k 2 f1 2 : : : mng and (k mn) = 1. De ne a and b by
; ;

k a (mod m) 0 a < m k b (mod n) and 0 b < n:


Since k = a + tm for some integer t and since (k m) = 1, we deduce that (a m) = 1. Similarly, (b n) = 1. Hence, there are i 2 f1 2 : : : (m)g and j 2 f1 2 : : : (n)g such that k ai (mod m) and k bj (mod n): Since there are (m) (n) choices of pairs (i j ) and k is uniquely determined by the above congruences (i.e., because of the Chinese Remainder Theorem), we get (mn) (m) (n). Now, x a pair (i j ) with i 2 f1 2 : : : (m)g and j 2 f1 2 : : : (n)g, and consider the integer k 2 f1 2 : : : mng (that exists by the Chinese Remainder Theorem) which satis es k ai (mod m) and k bj (mod n). There exists an integer t such that k = ai + tm so that, since (ai m) = 1, we obtain (k m) = 1. Also, (k n) = 1. Hence, (k mn) = 1. Therefore, since each pair (i j ) corresponds to a di erent k, (mn) (m) (n). Combining the inequalities, we get (mn) = (m) (n). 1 e2 Theorem 15. Suppose n = pe pe rr , where e1 : : : er , and r are positive 1 p2 integers and p1 : : : pr are distinct primes. Then (n) =
r Y j =1 ej 1 j ( pe j ; pj ) = n
;

Y
pn
j

1 : 1; p

2 (using (n) = (p11 ) (pe rr )). Examples. Use the theorem to show that (100) = 40 and (140) = 48. A \sieve" proof of Theorem 15 can be given that doesn't make use of the lemmas. Observe that a positive integer m is not relatively prime to n if and only if m is divisible by some pj with j 2 f1 2 : : : rg. For distinct j1 : : : jk in f1 2 : : : rg, the number of positive multiples of pj1 pjk which are n is n=(pj1 pjk ). The inclusion-exclusion principle

Proof. The second equality is clear and the rst follows from Lemma 1 and Lemma e

15

implies that the number of positive integers n which are not divisible by p1 : : : pr 1 , or pr is r n r X X n X Y n n 1 : r n; p + ; + +( ;1) = n 1 ; p1 p2 : : : pr pj j =1 j j1<j2 r pj1 pj2 j1<j2 <j3 r pj1 pj2 pj3 j =1
;

The theorem follows. Comments: An open problem due to Carmichael is to determine whether or not there is a positive integer n such that if m is a positive integer di erent from n then (m) 6= (n). If such an n exists, it is known that if must be > 101000 . Some result in this direction can be obtained as follows. Observe that n 0 (mod 2) since otherwise (n) = (2n). Now, n 0 (mod 4) since otherwise (n) = (n=2). Now, n 0 (mod 3) since otherwise (n) = (3n=2) and n 0 (mod 9) since otherwise (n) = (2n=3). This approach can be extended (apparently inde nitely as long as one is willing to consider branching o into di erent cases).

Homework:

(1) Calculate (180) and (1323). (2) Prove that if n is a positive integer as in the comment above, then n > 1030 . (Hint: Eventually consider two cases depending on whether 13jn or 13 n.) (3) During the year 1985, a convenience store, which was open 7 days a week, sold at least one book each day, and a total of 600 books over the entire year. Must there have been a period of consecutive days when exactly 129 books were sold?
-

Polynomial Basics:
Z

Irreducible polynomials. A non-zero polynomial f (x) 2 x] with f (x) 6 1 is irreducible (over or in x]) if f (x) = g(x)h(x) with g(x) and h(x) in x] implies either g(x) 1 or h(x) 1. A non-zero polynomial f (x) 2 x] with f (x) 6 1 is reducible if f (x) is not irreducible. A non-constant polynomial f (x) 2 x] is irreducible over (or in x]) if f (x) = g(x)h(x) with g(x) and h(x) in x] implies either g(x) or h(x) is a constant. A non-constant polynomial f (x) 2 x] is reducible over if f (x) is not irreducible over . Examples. The polynomial x2 +1 is irreducible over and over . The polynomial 2x2 + 2 is reducible over and irreducible over . Comment: Suppose f (x) 2 x] and the greatest common divisor of the coe cients of f (x) is 1. Then f (x) is irreducible over the integers if and only if f (x) is irreducible over the rationals. Unique factorization in x]. It exists. Division algorithm for polynomials. Given f (x) and g(x) in x] with g(x) 6 0, there are unique polynomials q(x) and r(x) in x] such that f (x) = q(x)g(x) + r(x) and either r(x) 0 or deg r(x) < deg g(x). In the case where g(x) is monic, the polynomials q(x) and r(x) will be in x].
Z Z Z Z Q Q Q Q Q Q Q Z Q Z Q Z Z Z Q Z

16

1 x + 3 and r(x) = 9 x2 ; x + 5 . If f (x) = x4 + 4 and g(x) = 2x3 ; 3x2 + 2, then q(x) = 2 4 4 2 The Euclidean Algorithm. Illustrate by computing gcd(x9 +1 x8 + x4 +1). Note that this example is not meant to be typical in general the coe cients might not be integral. If we want gcd(f (x) g(x)) to be monic, then division by a constant may be necessary after performing the Euclidean algorithm. Given f (x) and g(x) in x], not both 0, there exist polynomials u(x) and v(x) in x] such that f (x)u(x) + g(x)v(x) = gcd(f (x) g(x)): The Euclidean algorithm can be used to compute such u(x) and v(x). The Remainder Theorem. The remainder when a polynomial f (x) is divided by x ; a is f (a). Observe that the division algorithm for polynomials implies that there is a polynomial q(x) 2 x] and a rational number r such that f (x) = (x ; a)q(x) + r the remainder theorem follows by letting x = a. As a corollary, we note that (x ; a)jf (x) if and only if f (a) = 0. The Fundamental Theorem of Algebra. A non-zero polynomial f (x) 2 x] of degree n has exactly n complex roots when counted to their multiplicity. In other words, if f (x) = Pn j j =0 aj x 2 x] is a non-zero polynomial with roots (counted to their multiplicity) 1 2 : : : n , then f (x) = an (x ; 1 )(x ; 2 ) (x ; n ):
Z Q Q C C

Examples. If f (x) = x3 + 2x + 1 and g(x) = x2 + 2, then q(x) = x and r(x) = 1.

Elementary Symmetric Functions. Expanding the above factorization of f (x) in terms of its roots, we deduce that ; f (x) = an xn ; 1 xn 1 + 2 xn 2 ; + (;1)n n
; ;

where
1

1+ 2+

+ n

1 2+ 1 3+

+ n

1 n

:::

n= 1 2

(in general, j is the sum of the roots of f (x) taken j at a time). We deduce the formula j = (;1)j an j =an for each j 2 f1 2 : : : ng. Any rational symmetric function of the roots 1 2 : : : n can be written in terms of the elementary symmetric functions j . Examples. Discuss the values of j when f (x) = x2 ; 3x + 2 = (x ; 1)(x ; 2). Also, given 1 2 3 4 are the roots of f (x) = x4 + 2x3 ; 3x + 5, compute the value of (1= 1 ) + (1= 2 ) + (1= 3 ) + (1= 4 ). Congruences Modulo Polynomials. Is x18 ; 3x15 + x6 ; x4 + 2x3 ; x2 ; 2 divisible by x2 + x + 1? If not, what's the remainder? Discuss the answer(s).
;

Homework:

(1) Calculate gcd(x5 ; 3x4 + 3x3 ; 6x2 + 2x ; 3 x4 ; 3x3 + 2x2 ; 3x + 1):

17

(2) Let

and

be the roots of x3 + x + 1 = 0: Calculate

Sk =

3 X

j =1

k j

for k = 1 2 : : : 10:

(3) Determine whether x4 + 1 is a factor of x25 + 2x23 + x17 + x13 + x7 + x3 + 1 using arithmetic modulo x4 + 1: (4) Consider all lines which meet the graph on y = 2x4 + 7x3 + 3x ; 5 in four distinct points, say (xi yi ) i = 1 2 3 4: Show that (x1 + x2 + x3 + x4 )=4 is independent of the line and nd its value.

Polynomials Modulo Integers, Part I: Theorem 16. Let p be an odd prime. The congruence x2 + 1 0 (mod p) has a

solution if and only if p 1 (mod 4). Proof: First suppose p 1 (mod 4). Then p = 4k + 1 for some positive integer k. Thus, (p ; 1)=2 is even. By Wilson's Theorem, we obtain
;1

(p ; 1)! 1 2

p;1 p+1 (p ; 2) (p ; 1) 2 2 p;1 p;1 ; (;2) (;1) 1 2 2 2 1 ! p ; 1 ! (mod p): (;1)(p 1)=2 p ; 2 2
;

Thus, in this case, x2 + 1 0 (mod p) has the solution x = ((p ; 1)=2)!. Now, suppose p 3 (mod 4). Then (p ; 1)=2 is odd. Assume there is an integer x such that x2 + 1 0 (mod p). Then x2 ;1 (mod p) implies (since (p ; 1)=2 is odd) that

xp

(x2 )(p 1)=2 (;1)(p 1)=2


; ;

;1

(mod p):

This contradicts Fermat's Little Theorem. Hence, the theorem follows. Corollary. There exist in nitely many primes 1 (mod 4). Before proving the corollary, we establish Theorem 17. There exist in nitely many primes. Proof 1 (Euclid's). Assume there are only nitely many primes, say p1 : : : pr . Then the number p1 pr + 1 is not divisible by any of the primes p1 : : : pr , contradicting the Fundamental Theorem of Arithmetic. Proof 2. The Fermat numbers Fn = 22n + 1 are odd numbers > 1 satisfying n Y Fn+1 ; 2 = Fj :
j =0

18

Hence, they are relatively prime, so there must exist in nitely many primes. Proof of Corollary. Consider the numbers n2 + 1 where n is an integer. By Theorem 16, the only primes dividing any such number are 2 and primes 1 (mod 4). Thus, it su ces to show there exist in nitely many primes dividing numbers of the form n2 + 1. Assume otherwise. Let p1 : : : pr be the primes which divide numbers of the form n2 + 1. Since (p1 pr )2 + 1 is not divisible by any of the primes p1 : : : pr , we obtain a contradiction. (1) Use an argument similar to Euclid's to prove there exist in nitely many primes 3 (mod 4). (2) Let f (x) be a non-constant polynomial in x]. Prove there exist in nitely many primes dividing numbers of the form f (n) where n 2 . (3) Let q be an odd prime, and let k be a positive integer. Let Nk = 2qk ; 1 = 2(qk ) ; 1. (a) Prove that q does not divide Nk . (b) Let p be a prime dividing Nk . Prove that p k1 (mod q). k ; k (q 1) k (q 2) q q (c) Explain why gcd Nk 2 +2 + 2q (q 3) + + 2q + 1 = 1. (d) Observe that xq ; 1 = (x ; 1)(xq 1 + xq 2 + xq 3 + + x + 1). Prove that there is a prime dividing Nk+1 which does not divide Nk . (e) Prove there are in nitely many primes p 1 (mod q). (4) Let n be an integer 3. Prove there exist in nitely many primes p which are not congruent to 1 modulo n.
Z Z
; ; ; ; ; ;

Homework:

Lagrange's Theorem: Theorem 18. Let f (x) 2 x] with f (x) 6 0. Let p be a prime, and let n = deg f .
Z

Then either the congruence () f (x) 0 (mod p) has at most n incongruent roots modulo p or p divides each coe cient of f (x). Proof. The theorem is clearly true if n = 0. Let m be a positive integer, and suppose the theorem holds for n < m. Consider f (x) 2 x] with deg f = m. If ( ) has no solutions, then the desired conclusion follows for f (x). Suppose then that ( ) has a solution, say a. Hence, there is an integer k such that f (a) = kp. This implies that x ; a is a factor of f (x) ; kp (by the Remainder Theorem). In other words, there is a g(x) 2 x] such that f (x) = (x ; a)g(x) + kp. Clearly, deg g = m ; 1. Observe that f (x) g(x)(x ; a) (mod p). We deduce that f (b) 0 (mod p) if and only if g(b) 0 (mod p) or b a (mod p). Since deg g = m ; 1, we deduce that either there are at most m ; 1 incongruent integers b modulo p that can satisfy g(b) 0 (mod p) or every coe cient of g(x) is divisible by p. In either case, the theorem follows. Comment: Theorem 18 is not true if the prime p is replaced by a composite number n. For example, x2 ; 1 0 (mod 8) has 4 incongruent solutions modulo 8. Also, 3x 0 (mod 9) has 3 incongruent solutions modulo 9.
Z Z

19

Suppose f (x) 0 (mod p) has n incongruent solutions modulo p, say a1 : : : an . Then f (x) (x ; a1 ) (x ; an ) (mod p):

Corollary. Let f (x) 2 x] be a monic polynomial of degree n, and let p be a prime.


Z

Also, g(x) 0 (mod p) has the n incongruent solutions a1 : : : an modulo p. Lagrange's Theorem implies that p divides each coe cient of g(x). Wilson's theorem can be established with the aid of Theorem 18. Let p be a prime. We want to prove (p ; 1)! ;1 (mod p). Let f (x) = xp 1 ; 1. By Fermat's Little Theorem and the above Corollary, we deduce f (x) (x ; 1)(x ; 2) (x ; (p ; 1)) (mod p): Letting x = 0, we obtain the desired result.
;

Proof. Let g(x) = f (x) ; (x ; a1 ) (x ; an). Since f (x) is monic, deg g n ; 1.

Primitive Roots:

De nition. Let a be an integer, and let n be a positive integer with gcd(a n) = 1. The order of a modulo n is the least positive integer d such that ad 1 (mod n). Comment: With a and n as above, the order of a modulo n exists since a (n) 1 (mod n). Furthermore, the order of a modulo n divides (n). To see this, consider integers x and y for which dx + (n)y = gcd(d (n)), where d is the order of a modulo n. Then it follows easily that agcd(d (n)) 1 (mod n), and the de nition of d implies that d = gcd(d (n)). This in turn implies dj (n) as claimed. De nition. If an integer a has order (n) modulo a positive integer n, then we say that a is a primitive root modulo n. Comment: Given a positive integer n, it is not necessarily the case that there exists a primitive root modulo n. There exists a primitive root modulo n if and only if n is 2, 4, pr , or 2pr where p denotes an odd prime and r denotes a positive integer. The remainder of this section deals with the case where n is a prime, and in this case we establish the existence of a primitive root. Theorem 19. There is a primitive root modulo p for every prime p. Furthermore, there are exactly (p ; 1) incongruent primitive roots modulo p. Lemma. Let n denote a positive integer. Then X (d) = n
where the summation is over all positive divisors of n. 1 e2 Proof of Lemma. Write n = pe pe rr where the pj are distinct primes and 1 p2 the ej are positive integers. Note that
dn
j

X
dn
j

(d) =

r ; Y

j =1

1 + (pj ) +

j + (pe j ):

20

Since,

1 + (pj ) + we deduce that

j + (pe j ) = 1 + (pj ; 1)(1 + pj +

ej j 1 + pe j ) = pj
;

X
dn
j

(d ) =

r Y j =1

j pe j = n:

Theorem 19 is an apparent consequence of the next more general theorem. Theorem 20. Let p be a prime, and let d be a positive divisor of p ; 1. Then the number of incongruent integers of order d modulo p is (d). Proof of Theorem 20. We rst show that xd ; 1 0 (mod p) has exactly d incongruent solutions modulo p. By Lagrange's Theorem, it su ces to show that there is at least d incongruent solutions. Assume there are < d incongruent solutions. Observe that xp 1 ; 1 = (xd ; 1)g(x) for some g(x) 2 x] for degree p ; 1 ; d. A number is a root of xp 1 ; 1 0 (mod p) if and only if it is a root of xd ; 1 0 (mod p) or g(x) 0 (mod p). By Lagrange's Theorem, g(x) 0 (mod p) has at most p ; 1 ; d incongruent solutions modulo p. Hence, xp 1 ; 1 0 (mod p) has < d +(p ; 1 ; d) = p ; 1 incongruent solutions modulo p. This contradicts Fermat's Little Theorem. Hence, xd ; 1 0 (mod p) must have exactly d incongruent solutions modulo p. Next, suppose a has order d modulo p. We show that a is a root of xd ; 1 0 (mod p) if and only if d jd. If d jd, then d = kd for some integer k so that
;

ad ; 1 (ad )k ; 1 1 ; 1 0 (mod p):


0

Hence, a is a root of xd ; 1 0 (mod p). Now suppose we know a is a root of xd ; 1 0 (mod p) and we want to prove d jd. There are integers q and r such that d = d q + r and 0 r < d. Since 1 ad ad q+r (ad )q ar ar (mod p) we deduce that r = 0 and, hence, d jd as desired. We proceed to prove the theorem by induction. If d = 1, then the theorem is clear. Suppose the theorem holds for d < D. Then using the above information (including the Lemma), we have
0 0 0 0 0

D = jfa : aD ; 1 0 (mod p) 0 a < pgj X = jfa : a has order d 0 a < pgj d D X = (d ) + jfa : a has order D 0 a < pgj
0 0j 0

d D d <D
0

X
0 0j

= D ; (D) + jfa : a has order D 0 a < pgj:

d D

(d ) ; (D) + jfa : a has order D 0 a < pgj


0

21

The theorem follows. Comment: If g is a primitive root modulo p, then the numbers 1 g g2 : : : gp 2 are incongruent modulo p. It follows that the numbers 1 g g2 : : : gp 2 are congruent modulo p to the numbers 1 2 : : : p ; 1 in some order. Corollary. For all odd primes p, there are exactly (p ; 1)=2 non-zero incongruent squares modulo p. Proof. If x a2 (mod p) for some integer a with a 6 0 (mod p), then x(p 1)=2 ap 1 1 (mod p). Hence, Lagrange's Theorem implies that there are (p ; 1)=2 non-zero incongruent squares modulo p. On the other hand, if g is a primitive root modulo p, then the numbers 1 g2 g4 : : : gp 3 form (p ; 1)=2 non-zero incongruent squares modulo p. Example. Illustrate the above by considering p = 7. Here, 3 is a primitive root, and the non-zero squares are 1, 2, and 4. Comment: It is not known whether 2 is a primitive root modulo p for in nitely many primes p. On the other hand, it is known that at least one of 2, 3, and 5 is a primitive root modulo p for in nitely many primes p.
; ; ; ; ;

(1) (a) Using an argument similar to that given P for the proof of the lemma to Theorem e e e 1 2 r 20, show that if n = p1 p2 pr and (n) = d n d (i.e., (n) is the sum of the positive divisors of n), then r pej +1 ; 1 Y j (n) = : j =1 pj ; 1 P (b) Let (n) = d n 1 (i.e., (n) is the number of positive divisors of n). With n as above and using a similar argument to the above, show that
j j

Homework:

(n) = (e1 + 1) (e2 + 1)

(er + 1) :

(2) Let n be a positive integer. Given the notation in (1)(b) above, prove

X
dn
j

(d)

X
dn
j

3 (d):

(3) Let p be a prime, let g be a primitive root modulo p, and let k be an integer. Prove that gk is a primitive root modulo p if and only if gcd(k p ; 1) = 1. (4) (a) Prove that if p is a prime 1 (mod 3), then there are exactly (p ; 1)=3 non-zero incongruent cubes modulo p. (b) Prove that if p is a prime 6 1 (mod 3), then there are exactly p ; 1 non-zero incongruent cubes modulo p. (Hint: If gj doesn't look like a cube, maybe gj +(p 1) or gj +2(p 1) will.)
; ;

22

(c) Generalize parts (a) and (b) to kth powers modulo a prime. In other words, nd a precise description similar to the above for the number of kth powers modulo a prime.

Euler's Criterion: Theorem 21. Let p be an odd prime, and let a be an integer not divisible by p. If
; ; ;

a is a square modulo p, then a(p 1)=2 1 (mod p). If a is not a square modulo p, then a(p 1)=2 ;1 (mod p). Proof: In the rst line of the proof of the Corollary to Theorem 20, we saw that non-zero squares modulo p are roots of xp 1 ; 1 0 (mod p). This is the rst half of Theorem 21. It remains to prove now that if a is not a square modulo p, then a is a root of x(p 1)=2 + 1 0 (mod p). Observe that every integer in f1 2 : : : p ; 1g satis es
;

(x(p 1)=2 ; 1)(x(p 1)=2 + 1) xp


; ; ;

1 ;1

0 (mod p)
; ;

so that if a 2 f1 2 : : : p ; 1g, then a is a root of either x(p 1)=2 ; 1 0 (mod p) or x(p 1)=2 + 1 0 (mod p) (and not both). By Lagrange's Theorem, x(p 1)=2 ; 1 0 (mod p) can have at most (p ; 1)=2 incongruent roots. By the rst part of the proof, these roots are the non-zero squares modulo p. It follows that the remaining integers in f1 2 : : : p ; 1g must satisfy x(p 1)=2 + 1 0 (mod p), completing the proof. Example. Determine if 3 is a square modulo 31. Use that 33 ;4 (mod 31) =) 6 3 16 (mod 31) =) 39 ;2 (mod 31) =) 315 ;1 (mod 31). By Euler's criterion, 3 is not a square modulo 31.
;

De nition. Let p be a prime, and let a be an integer not divisible by p. If a is a square modulo p, then a is said to be a quadratic residue modulo p. Otherwise, we say that a is a quadratic nonresidue modulo p. De nition. Let p be a prime, and let a be an integer. The Legendre symbol a p is de ned by 8 > 1 if a is a quadratic residue mod p a = < 0 if a 0 (mod p) > p : ;1 otherwise:

Quadratic Residues:

a p

Comment. For p an odd prime and a an integer, Euler's criterion is equivalent to


a(p 1)=2 (mod p).
;

hold. b a (i) If a b (mod p), then p = p . 2 (ii) If a 6 0 (mod p), then a = 1.

Theorem 22. Let a and b be integers, and let p be a prime. Then the following
p

23

ab = a b . p p p P 1 a = 0. (iv) If p is odd, then p a=1 p Proof. The de nition of the Legendre symbol immediately implies (i) and (ii). Euler's criterion implies (iii) (deal with p = 2 separately). Finally, (iv) follows from the fact that if p is odd, then there are (p ; 1)=2 quadratic residues and (p ; 1)=2 quadratic nonresidues in the sum (see the Corollary to Theorem 20). Evaluating the Legendre symbol. One can evaluate the Legendre symbol directly from the de nition or with the aid of Euler's criterion. The latter done correctly is quite e cient. Another method which works somewhat better (especially by hand) is to make use of the following three theorems. 1 = 1 if p 1 (mod 4) Theorem 23. For p an odd prime, ; p ;1 if p ;1 (mod 4): 1 (mod 8) 2 = 1 if p Theorem 24. For p an odd prime, p ;1 if p 3 (mod 8): Theorem 25. If p and q are odd primes, then 8 q > > if p 1 (mod 4) or q 1 (mod 4) p =< p > q : ; q if p q ;1 (mod 4): p
(iii)
;

Theorem 23 and Theorem 24 follow as a consequence of Theorem 25. Theorem 23 is an immediate consequence of previous material. Euler's criterion implies 1 if p 1 (mod 4) ;1 = ( ;1)(p 1)=2 = p ;1 if p ;1 (mod 4): Theorem 23 is also equivalent to Theorem 16. 17 = 1 using the above results. Hence, ;17 is a Examples. Show that ; 79 quadratic residue modulo 79. Also, discuss whether x2 ; x ; 1 factors modulo 7 and modulo 11. Describe the primes p for which x2 ; x ; 1 factors modulo p. A further example. Here we show that there are no integers x and y satisfying the Diophantine equation () y2 = x3 + 11: Assume integers x and y exist satisfying ( ). By considering ( ) modulo 4, we deduce that x 1 (mod 4) (i.e., since 0 and 1 are the only squares modulo 4). Observe that ( ) implies y2 + 16 = x3 + 27 = (x + 3)(x2 ; 3x + 9):
;

Comment. In some sense, only Theorem 25 is needed here as it can be shown that

24

Since x 1 (mod 4), we deduce x2 ; 3x + 9 3 (mod 4). This implies; that there is a prime p 3 (mod 4) dividing x2 ; 3x +9 and, hence, y2 +16. This implies y 4 1 2 ;1 (mod p). This contradicts Theorem 23. Hence, ( ) has no integer solutions.
;

30 and ;56 . (1) Calculate the Legendre symbols 71 103 (2) Let p denote a prime. Prove that there is a solution to x2 ; 3x + 3 0 (mod p) if and only if p = 3 or p 1 (mod 3). (3) Prove that for every prime p, there is an a 2 f1 2 : : : 9g such that both a and a + 1 are squares modulo p. (4) Prove that there are no integers x and y such that y2 = x3 + 7. 1 = 1, 2 = 1, or ;2 = 1. (5) (a) For every odd prime p, prove either ; p p p (b) Prove that x4 + 1 is reducible modulo p for every prime p. (6) Prove that for every positive integer N , there is an integer a such that a is not a square modulo p for every odd prime p N . (Hint: Use a major theorem from earlier in this course.) (7) Note that 107 and (107 ; 1)=2 = 53 are primes. 15 . (a) Calculate the Legendre symbol 107 (b) The value of 1553 is either 1 or ;1 modulo 107. Use Euler's criterion together with part (a) to determine (with explanation) whether 1553 1 (mod 107) or 1553 ;1 (mod 107). (c) Using part (b), explain why 15 is a primitive root modulo 107.

Homework:

Gauss' Lemma and the Proof of Theorem 24: Theorem 26. Let p be an odd prime, and let a be an integer not divisible by p. Let
n denote the number of integers in the set S = fa 2a 3a : : : ((p ; 1)=2)ag which have a remainder > p=2 when divided by p. Then a = (;1)n : p

Before proving Theorem 26, we explain its connection to Theorem 24. Proof of Theorem 24 assuming Theorem 26. Here a = 2 and S = f2 4 6 : : : p ; 1g. If p 1 (mod 4), then the elements of S which have a remainder > p=2 when divided by p are ((p ; 1)=2) + 2k for k = 1 2 : : : (p ; 1)=4. Hence, n = (p ; 1)=4 and we obtain 2 = (;1)(p 1)=4 = 1 if p 1 (mod 8) p ;1 if p ;3 (mod 8):
;

Comment: Observe that Theorem 23 is a consequence of Theorem 26.

25

If p 3 (mod 4), then the elements of S which have a remainder > p=2 when divided by p are ((p ; 1)=2) + 2k ; 1 for k = 1 2 : : : (p + 1)=4. Thus, n = (p + 1)=4 and we obtain 2 = (;1)(p+1)=4 = 1 if p ;1 (mod 8) p ;1 if p 3 (mod 8): This completes the proof.
0

> p=2 when divided by p. Let b1 : : : bm be the remaining elements of S . Let aj (for 1 j n) and bj (for 1 j m) be de ned by
0

Proof of Theorem 26. Let a1 : : : an be the elements of S which have a remainder


aj aj (mod p) 0 aj < p bj bj (mod p) and 0 bj < p:
0 0 0 0

Let T = fp ; aj : 1 j ng fbj : 1 j mg. We begin by showing that T = f1 2 : : : (p ; 1)=2g. Note that T f1 2 : : : (p ; 1)=2g and that n + m = (p ; 1)=2. Hence, it su ces to show the n + m elments de ning T are distinct. If u and v are in f1 2 : : : (p ; 1)=2g and ua va (mod p), then u v (mod p). It follows that the n values of p ; aj are distinct and the m values of bj are distinct. Assume k 2 f1 2 : : : ng and ` 2 f1 2 : : : mg are such that p ; ak = b` . Then there are u and v in f1 2 : : : (p ; 1)=2g such that p ; ua va (mod p). This implies (u + v)a 0 (mod p) which contradicts that p a and 2 u + v p ; 1. We deduce that T = f1 2 : : : (p ; 1)=2g. From T = f1 2 : : : (p ; 1)=2g, we obtain
0 0 0 0 0 0

p ; 1 ! (p ; a ) (p ; a )b b (;1)na a b b 1 n 1 m 1 n 1 m 2 p ; 1 a (;1)n a(p 1)=2 p ; 1 ! (mod p): (;1)n a(2a)(3a) 2 2 Therefore, by Euler's criterion, a a(p 1)=2 (;1)n (mod p) p and Theorem 26 follows.
0 0 0 0 0 0 0 0 ; ;

The Quadratic Reciprocity Law: Lemma. If p is an odd prime and a is an odd integer with p not dividing a, then
a = (;1) k=1 p
where ] denotes the greatest integer function.
(pX ;1)=2

ka=p]

26

Proof. We use the notation given in the proof of Theorem 26. For each k f1 2 : : : (p ; 1)=2g, we have

ka = qk p + tk with 1 tk p ; 1
where if tk > p=2 then tk is some aj and if tk < p=2 then tk is some bj . Observe that qk = ka=p]. Thus,
0 0

() Recall that
fp ; a0 j

(p; 1)=2 X

k=1

ka =

(p; 1)=2 X

k=1

n m X ka p + X aj + bj : p j =1 j =1
0 0

: 1 j ng
(p; 1)=2 X

fb0 j

: 1 j mg = f1 2 : : : (p ; 1)=2g:
n X j =1

Hence,

k=1

k=

(p ; aj ) +
0

m X j =1

bj :
0

Combining this with ( ) gives (a + 1)


(p; 1)=2 X

k=1

k=

(pX ;1)=2

k=1

m ka p + pn + 2 X bj : p j =1
0

ka n (mod 2). The result now follows from Since a and p are odd, we obtain p k=1 Theorem 26. Proof of Theorem 25. If p = q, then the result is clear. So suppose p 6= q. It su ces to prove in this case that p q p;1 q;1 q = (;1) 2 2 : p

(p; 1)=2 X

Consider the rectangle R in the xy-plane with vertices (0 0), (p=2 0), (p=2 q=2), and 1 q ; 1 . We now count (0 q=2). The number of lattice points strictly inside R is p ; 2 2 these points in a di erent way. Let D denote the diagonal joining (0 0) to (p=2 q=2). Thus, D is a segment of the line py = qx. If (x0 y0 ) is a lattice point on this line, then pjx0 . Therefore, (x0 y0 ) is not strictly inside R. It follows that the number of lattice points strictly inside R is the number of such points below D plus the number of such points

27

above D. The number of such lattice points below D is such lattice points above D is
(pX ;1)=2 (q; 1)=2 X

(pX ;1)=2

k=1

kp . We deduce that q
;

k=1

kq , and the number of p

k=1

1)=2 kq + (qX kp = p ; 1 p q 2 k=1 (pX ;1)=2

q ; 1: 2

The lemma now implies

p q

q = (;1) k=1 p

1)=2 kp kq + (qX p;1 q;1 p q k=1 2 = (;1) 2


;

completing the proof.

Homework:

(1) Let !(n) denote the number of incongruent solutions to x2 1 (mod 2n ). Observe that !(1) = 1, !(2) = 2, and !(3) = 4. Prove that !(n) = 4 for all n 3. (Indicate clearly where you use that n 3.)

Sums of Two Squares: Theorem 27. A positive integer n is a sum of two squares if and only if every
prime p 3 (mod 4) satis es pe jjn for some even number e. Proof. First, we show that if n is a sum of two squares and p2k+1 jjn for some nonnegative integer k, then either p = 2 or p 1 (mod 4). Write n = p2k+1 m for some integer m not divisible by p. Let a and b be such that n = a2 + b2 . Let ` be the non-negative integer satisfying p` jja, and write a = p` a so that a 2 and p a . If ` k + 1, then
0 0

b2 = n ; a2 = p2k+1 m ; p2` (a )2 = p2k+1 (m ; p2` 2k 1 (a )2 ):


0 ; ; 0

This is impossible since p does not divide m ; p2` 2k 1 (a )2 and p2k+1 jb2 =) p2k+2 jb2 . Thus, ` k and p2` jj(n ; a2 ). In other words, b = p` b where b is an integer not divisible by p. From n = a2 + b2 and p2k+1 jn, we deduce (a )2 + (b )2 0 (mod p). Hence, (a (b ) 1 )2 ;1 (mod p). By Theorem 23, we conclude as desired that either p = 2 or p 1 (mod 4). Now, suppose that every prime p 3 (mod 4) satis es pe jjn for some even number e. Observe that 2 = 12 + 12 (i.e., 2 is a sum of two squares). We want to show that n is a sum of two squares. It su ces to show (i) if k and ` are both sums of two squares, then so is k`, (ii) if p 3 (mod 4), then p2 is the sum of two squares, and (iii) if p 1 (mod 4), then p is the sum of two squares. To prove (i), let a, b, a , and b be integers such that
; ; 0 0 0 0 0 0 0 ; 0 0

28

k = a2 + b2 and ` = (a )2 + (b )2 . Then k = (a + bi)(a ; bi) and ` = (a + b i)(a that


0 0 0 0

; b0 i)

so

k` = (a + bi)(a + b i)(a ; bi)(a ; b i) = ((aa ; bb ) + (ab + a b)i)((aa ; bb ) ; (ab + a b)i) = (aa


0 0 0 0 0 0 0 0 0 0 0 0

; bb0 )2 + (ab0 + a0 b)2 :

To prove (ii), simply observe that p2 = 02 + p2 is the sum of two squares. We now turn to establishing (iii). Since pp 1 (modp 4), there is an integer x0 such that x2 0 ;1 (mod p). p 2 Let m = p]+1 so that p < m < p +1. In particular, m > p which implies m2 p +1. Let S1 = fk 2 : jkj m ; 1g. Since jS1 j = 2m ; 1 and 2m ; 1 + m(m ; 2) = m2 ; 1 p, we can nd m ; 2 sets S2 : : : Sm 1 satisfying
Z
;

S1 S2

Sm 1 = f;(m ; 1) ;(m ; 2) : : : ;1 0 1 : : : p ; m ; 1 p ; mg
;

with each Sj consisting of m consecutive integers and with every two Si and Sj with 1 i < j m ; 1 being disjoint. Observe that for every integer t there is a unique j 2 f1 2 : : : m ; 1g such t is congruent modulo p to some element of Sj . Consider the m numbers sx0 where 0 s m ; 1. By the pigeonhole principal, some two of these, say ux0 and vx0 , are congruent modulo p to elements in the same Sj . Fix such u, v, and j . If j = 1 and uv 6= 0, then reassign the value of u so that u = 0. It follows that (v ; u)x0 is congruent modulo p to some element in S1 . Let k = jv ; uj so that k 2 f1 2 : : : m ; 1g and kx0 is congruent modulo p to some element in S1 . Let a kx0 (mod p) with a 2 S1 , and set b = k. Then a2 + b2 k2 (x2 0 + 1) 0 (mod p): Also, p p ja2 + b2 j (m ; 1)2 + (m ; 1)2 < ( p)2 + ( p)2 = 2p: Since b = k 1, we obtain a2 + b2 2 (0 2p). Since a2 + b2 is divisible by p, we deduce a2 + b2 = p. This completes the argument for (iii) and completes the proof of the theorem.

Polynomial Congruences Modulo Composite Numbers:


Z

Reduction to prime powers. We have dealt with solving quadratic polynomials modulo primes we deal now with the general congruence f (x) 0 (mod m) where f (x) 2 1 x] and m = pe pe rr with the pj denoting distinct primes and the ej denoting positive 1 integers. Given an integer x0 , it is easy to see that f (x0 ) 0 (mod m) if and only if e j f (x0 ) 0 (mod pj ) for every j 2 f1 2 : : : rg. In other words, solving the congruence j f (x) 0 (mod m) is the same as solving the system of congruences f (x) 0 (mod pe j ) with j 2 f1 2 : : : rg. We discuss an approach to solving f (x) 0 (mod pe ). Once this congruence can be solved, we can piece together the solution with di erent prime powers by using the Chinese Remainder Theorem. The third example below illustrates how this is done. Solving congruences modulo prime powers. Let f (x) 2 x], and let p be a prime. To nd the roots of f (x) modulo a power of p, we rst nd the solutions to f (x) 0 (mod p)
Z

29

and inductively increase the exponent of p in the modulus. For this purpose, suppose that e is an integer 2, we know the solutions to the congruence f (x) 0 (mod pe 1 ), and we want to know the solutions to f (x) 0 (mod pe ). We begin with an integer x0 satisfying f (x0 ) 0 (mod pe 1 ) and determine the integers u x0 (mod pe 1 ) for which f (u) 0 (mod pe ). All integers u satisfying f (u) 0 (mod pe ) can be obtained this way as such u also satisfy f (u) 0 (mod pe 1 ). Since u x0 (mod pe 1 ), there is an integer k such that u = x0 + kpe 1 . We may further suppose that k 2 f0 1 : : : p ; 1g since f (u) 0 (mod pe ) holds if and only if f (u + `pe ) 0 (mod pe ) holds for every integer `. From Calculus, we can write
; ; ; ; ; ;

(x) (kpe 1 )2 + : f (x + kpe 1 ) = f (x) + f (x)kpe 1 + f 2! Observe that there are a nite number of terms on the right-hand side above and that f (`) (x)=`! 2 x] for every positive integer `. Note that e 2 implies 2(e ; 1) e. Hence,
00 ; 0 ; ;

()
0 0 0

0 f (x0 + kpe 1 ) f (x0 ) + f (x0 )kpe


; 0 0

(mod pe ):
;

If f (x0 ) 0 (mod p) and f (x0 ) 0 (mod pe ), then ( ) is true for all integers k. If f (x0 ) 0 (mod p) and f (x0 ) 6 0 (mod pe ), then ( ) is not true regardless of k. If f (x0 ) 6 0 (mod p), then f (x0 ) has an inverse modulo p. Also, f (x0 ) 0 (mod pe 1 ) so pe 1 jf (x0 ). In this case, ( ) has the unique solution k 2 f0 1 : : : p ; 1g given by
;

( )

; e;1 p

f (x0 ) f (x ) 0
0

(mod p):
;

Summarizing, we have that for a given solution x0 of f (x) 0 (mod pe 1 ), one of the following occurs: (i) f (x0 ) 0 (mod p) and f (x0 ) 0 (mod pe ) and there are p incongruent solutions u modulo pe to f (x) 0 (mod pe ) with u x0 (mod pe 1 ) and they are given by u = x0 + kpe 1 where k 2 f0 1 : : : p ; 1g, (ii) f (x0 ) 0 (mod p) and f (x0 ) 6 0 (mod pe ) and there do not exist solutions u to f (x) 0 (mod pe ) with u x0 (mod pe 1 ), or (iii) f (x0 ) 6 0 (mod p) and there is exactly one solution u modulo pe to f (x) 0 (mod pe ) with u x0 (mod pe 1 ) and it is given by u = x0 + kpe 1 with k satisfying ( ). Two examples. Let f (x) = x2 + x + 1 and p = 3. Then f (1) 0 (mod 3). In fact, every integer satisfying f (x) 0 (mod 3) is congruent to 1 modulo 3. Since f (x) = 2x +1, we deduce that f (1) 0 (mod 3) and f (1) 3 6 0 (mod 32 ). By (ii), f (x) 0 (mod 32 ) has no solutions and so neither does f (x) 0 (mod 3e ) for each e 2. Now, suppose f (x) = x2 + 4x + 4 and p = 3. Note that modulo 3, f (x) is the same here as in the previous problem. Again, all solutions to f (x) 0 (mod 3) are 1 modulo 3. Also, f (1) 0 (mod 3) and f (1) 0 (mod 32 ). Thus, by (i), there are three incongruent solutions to f (x) 0 (mod 32 ) given by 1, 4, and 7. Observe that if x0 represents any one of these three solutions, then f (x0 ) f (1) 0 (mod 3). Also, f (1) 9 6 0 (mod 33 ),
0 ; ; 0 ; 0 ; ; 0 0 0 0 0

30

f (4) 36 6 0 (mod 33 ), and f (7) 81 0 (mod 33 ). By (i) and (ii), there exist exactly three incongruent solutions to f (x) 0 (mod 33 ) given by 7, 16, and 25. Observe that solving f (x) 0 (mod 3e ) is actually easy since f (x) = (x + 2)2 . If k is the least integer greater than or equal to e=2, then f (x) 0 (mod 3e ) if and only if x + 2 0 (mod 3k ). It follows that f (x) 0 (mod 3e ) has exactly 3e k solutions given by 3k ` ; 2 where ` 2 f1 2 : : : 3e k g. A third example. Here we calculate all incongruent solutions modulo 175 to
; ;

x3 + 2x2 + 2x ; 6 0 (mod 175):


Since 175 = 52 7, we consider f (x) 0 (mod 25) and f (x) 0 (mod 7) where f (x) = 2 = ;1, the only x3 + 2x2 + 2x ; 6. Since f (x) (x ; 3)(x2 + 2) (mod 5) and ; 5 solutions of f (x) 0 (mod 5) are 3 modulo 5. Since f (3) 41 1 6 0 (mod 5) and f (3) = 45, we obtain from (iii) that the all solutions to f (x) 0 (mod 25) are congruent to 3 + 5(;9) 8 modulo 25. One checks directly that the incongruent solutions modulo 7 to f (x) 0 (mod 7) are 2, 4, and 6. It follows that there are exactly three incongruent solutions modulo 175, say x1 , x2 , and x3 , satisfying
0

x1 8 (mod 25) x1 2 (mod 7)

x2 8 (mod 25) x2 4 (mod 7)

x3 8 (mod 25) x3 6 (mod 7):

By the proof of the Chinese Remainder Theorem,

x1 8 7 (;7) + 2 25 2 ;392 + 100 ;292 58 (mod 175) x2 8 7 (;7) + 4 25 2 x1 + 100 158 (mod 175) and x3 8 7 (;7) + 6 25 2 x2 + 100 83 (mod 175):
Thus, f (x) 0 (mod 175) has exactly three incongruent solutions modulo 175 given by 58, 83, and 158.

Homework:

(1) Find all the incongruent solutions modulo 135 to x5 + x3 + 5x + 15 0 (mod 135). Do this in the method described above showing your work as in the third example.

Tossing Coins Over The Phone:

Two people A and B agree over the phone to get together at either A's house or B 's house, but each is too lazy to volunteer going over to the other's house. Since B is thinking rather quickly, he says, \I'll toss a coin and you call heads or tails. If you are right, I'll come over to your house. If you are wrong, you have to come over here." It so happens that A is thinking even better, and she suggests the following fair way to toss a coin over the phone.

31

Step 1: A forms a number n = pq where p and q are distinct large primes congruent to

3 modulo 4. The primes are small enough that they can pass current primality tests and large enough so that n cannot be factored using current factoring methods. A tells B what the value of n is. Step 2: B chooses k 2 f1 2 : : : n;1g, computes ` k2 (mod n) with ` 2 f1 2 : : : n;1g, and tells A what ` is. (We suppose that gcd(k pq) = 1 since p and q are large, this is very likely. In any case, the coin toss is not perfect because of this assumption.) Step 3: A tries to gure out what k is. She knows ` k2 (mod p) and ` k2 (mod q). Note that p 3 (mod 4) so that (p + 1)=4 2 . The value of k modulo p can be determined by computing k1 `(p+1)=4 (mod p). To see this, observe that
Z

2 k1

; (p+1)=4 `

`(p+1)=2 `(p 1)=2 ` kp 1 ` ` (mod p):


; ;

Note that Lagrange's Theorem implies the incongruent solutions of x2 ` (mod p) are precisely k modulo p. Hence, k1 k (mod p). Also, A computes k2 `(q+1)=4 (mod q) so that k2 k (mod q). Observe that the solutions modulo n of x2 ` (mod n) are given by (i) x k1 (mod p) (ii) x ;k1 (mod p) (iii) x k1 (mod p) (iv) x ;k1 (mod p) and and and and

x k2 (mod q) x ;k2 (mod q) x ;k2 (mod q) x k2 (mod q)

A computes u 2 f1 2 : : : n ; 1g satisfying (i) and v 2 f1 2 : : : n ; 1g satisfying (iii). Then the solution to (ii) is x ;u (mod n) and the solution to (v) is x ;v (mod n). Note that v 6 u (mod n) as u + v is not divisible by p and u ; v is not divisible by q. Since k2 ` (mod n), we deduce that either k u (mod n) or k v (mod n) but not both. A selects one of u or v, say w, and tells B that she is guessing that k is one of w and n ; w. Step 4: B checks if k is one of w and n ; w. If it is, then B admits it (so he has to go over to her place). If k is not one of w and n ; w, then B tells A that she was incorrect. In this event the conversation continues as B must convince A that he is not lying. To prove that B is telling the truth, B tells A how n factors. B determines this as follows. Suppose w = u (in the case that w = v, the factorization of n is determined in a similar way) so that k v (mod n). From the de nition of u and v, it follows that w + k is divisible by exactly one of p and q. Hence, B can determine p or q by computing gcd(n w + k). (Observe that B does not know which of the two numbers u and n ; u given to him is w, but either one can be used since gcd(n n ; w + k) is also either p or q.) This easily enables B to factor n. Thus, in the event that B claims that A's guess of w or n ; w for k is incorrect, B veri es that A is incorrect by giving A the factorization of n.

32

Let f and g be real-valued functions with domain containing an interval c 1) for some real number c. We say that f (x) is big oh of g(x) and write f (x) = O(g(x)) if there is a constant C > 0 such that jf (x)j Cg(x) for all x su ciently large. We say f (x) is less than less than g(x) and write f (x) g(x) if f (x) = O(g(x)), and we say f (x) is greater than greater than g(x) and write f (x) g(x) if g(x) = O(f (x)). We say the asymptotic order of f (x) is g(x) and write f (x) g(x) (or f (x) g(x)) if g(x) f (x) g(x). We (x) = 0. We say that say that f (x) is little oh of g(x) and write f (x) = o(g(x)) if xlim f g(x) (x) = 1. Analogous de nitions f (x) is aymptotic to g(x) and write f (x) g(x) if xlim f g(x) exist if the domain is in the set of positive integers. Examples. Discuss each of the following: n n 2 X X p p 1 1 = O(1=x): 2 p x + 1 ; x log 1 + k n k n 2 x x k=1 k=1
!1 !1

De nitions and Notations for Analytic Estimates:

O(g(x)). To clarify, the last equation in X Xx X x Xx = + O 1 = + O(x) p p p p x p x p x p x X does not assert that a function is O 1 if and only if it is O(x) but rather there is a p x X function f (x) that satis es f (x) = O 1 and f (x) = O(x). Indeed, in the equation p x X x x ; . above, the big oh expressions both represent the same function f (x) = p p p x X1 An estimate using integrals. Explain why log x. k k x

Comment: The expression O(g(x)) in an equation represents a function f (x) =

Homework:

(1) Let f : + ! + and g : + ! + . Find all possible implications between the following. In each case, give a proof or a counterexample. (a) f (x) g(x) (b) f (x) = g(x) + O(1) (c) f (x) ; g(x) 1 (d) f (x) = g(x) + o(g(x)) X1 (2) (a) Prove that k 1 + log x for all x 1.
R R R R

k x

X1 log x. k k x X 1 = log x + O(1). (c) Prove that k xk (3) (a) How many positive integers 210 are not divisible by each of the primes 2, 3, 5, and 7? For example, 11 would be such an integer but 39 would not be. (b) Let A(x) = jfn x : each of 2 3 5 and 7 does not divide ngj. Prove that A(x) cx for some constant c and determine the value of c. (4) Let a be a real number. Suppose f : a 1) ! has the property that for every t a, there exists an M (t) such that jf (x)j M (t) for all x 2 a t]. Suppose g : a 1) ! + has the property that for every t a, there exists an "(t) > 0 such that g(x) "(t) for all x 2 a t]. Finally, suppose that f (x) g(x). Prove that there is a constant C > 0 such that jf (x)j Cg(x) for all x a. (5) Let f : + ! and g : + ! + be Riemann integrable functions. Suppose that f (t) = O(g(t)). Prove or disprove that Zx Zx f (t) dt = O g(t) dt :
(b) Prove that
R R R R R R

33

Sums and Products Involving Primes: Y 1 for all x > 1. 1 Lemma. 1; p log x
1 Y X1 1+ 1 + 1 = 1+ p log x: 1; p p2 p x k xk p x Comment: Observe that the lemma gives another proof that there are in nitely many primes. X1 X 1 Theorem 28. The series diverges. In fact, p p log log x.

Proof. The lemma follows from


Y
;

p x

Proof. For x > 1, the lemma implies


; log

p prime

p x

On the other hand, Y 1 = X log 1 ; 1 = ; X 1 + 1 + 1 + log 1; p 2 3p3 p p x p x p 2p p x X 1 1 1 X1 ; + + + = ; + C (x) 2 p3 p x p p p xp

p x

1; 1 p

log log x:

34

where Hence,

jC (x)j

p x p(p ; 1)

n=2 n(n ; 1)

X
1

= 1: log log x:

X1 p xp

; log

Y
p x

1 1; p

;1

log log x ; 1

Comment: The sum of the reciprocals of every prime ever written down is < 4. X p Theorem 29. log log x. p Proof. Observe that
p x

log x. Therefore, X XX XX X x log p x log x log n log p = log p = n x n x pn p xn x p x p


j

n x

log n

x log x since the sum consists of x] terms each

X log p X X log p =x + O log p = x + O x log x : p p p x p x p x


The result follows. 1 . log x p x Proof. The lemma implies the part of the asymptotic relation. We begin in a manner similar to the proof of the lemma. We use that 1 Y Y X1 1 1+ 1 + 1; p = 1+ p +S p2 p x p x k yk

pn
j

Theorem 30.

1; 1 p

where y is an arbitrary number > 1 and where X log k X 1 S= k>y k log y k>y k
qk= q x
j )

1 = log y

X
)

qk= q x
j ) j

k>y qk= q x
j

1 X log p = 1 X log p X X 1 k pe k log y p x e 1 k>y pe k k


qk= q x
j ) j

1 X X log p log y p x e 1 pe

X
k 1 qk= q x
j )

1 = 1 X X log p Y 1 ; 1 k log y p x e 1 pe q x q

35

By Theorem 29, there is a constant c > 0 such that X X log p X log p X log p = 2 e p xe 1 p p x p;1 p x p Setting P = that

c log x:

Y
p x

1 1; p

and using the previous homework problem (2)(a), we deduce =) log x P 1 ; clog y 1 + log y:

Taking y = x4c , we obtain (3=4)P 1 + 4c log x from which P log x follows. This implies the part of the asymptotic relation in the statement of the theorem. X1 Theorem 31. p = log log x + O(1).

x)P 1 + log y + c(log log y

Proof. From the proof of Theorem 28,


log

p x

Y
p x

X1 1; 1 = ; p p + C (x)
p x

where jC (x)j 1:

By Theorem 30, there exist constants c1 > 0 and c2 > 0 (and we may in fact take c2 = 1) such that c1 < Y 1 ; 1 < c2 log x p log x
p x

provided x is su ciently large (but note that problem (3) in the previous homework implies x 2 will do). Hence, for x su ciently large, it follows that Y 1 = ; log log x + O(1): log 1; p p x We deduce then that Y X1 1 + C (x) = log log x + O(1): = ; log 1 ; p p x p xp

Homework:

(1) (a) Prove that (log x)k = o(x" ) for every " > 0 and every k > 0. (b) Part (a) implies that log x to any power grows slower than x" for every " > 0. Find a function which grows slower than x" for every " > 0 and also grows faster than log x to any power. In other words, nd an explicit function f (x) such that f (x) = o(x" ) for every

36

" > 0 and (log x)k = o(f (x)) for every k > 0. Justify your answer. (Hint: Try f (x) = eu(x) for some appropriate u(x).) (c) Prove that (log log x)k = o((log x)" ) for every " > 0 and every k > 0. X 1 (d) Find with proof a function f : + ! + such that x log x = o(f (x)) and n=1 f (n) diverges. (2) Let pn denote the nth prime. It is known that pn cn log n for some constant c. Using this information and Theorem 31, prove that c = 1.
1

The Number of Prime Divisors of n:


Z R

Notation. The number of distinct prime divisors of n is denoted by !(n). De nition. Let f : + ! + and g : + ! + . Then f (n) is said to have normal order g(n) if for every " > 0, the number of positive integers n x satisfying (1 ; ")g(n) < f (n) < (1 + ")g(n) is asymptotic to x (i.e., for almost all positive integers n, f (n) 2 ((1 ; ")g(n) (1+ ")g(n))). TheoremX 32. !(n) has normal order log log n. Lemma. ;!(n) ; log log x 2 x log log x.
Z R

X;
n x

Proof. We examine each term on the right-hand side of the equation


!(n) ; log log x 2 =

n x

For the third term, we easily obtain X (log log x)2 = x(log log x)2 + O((log log x)2 ): For the second term, we use that X XX X !(n) = 1=
n x n xpn
j

n x

!(n)2 ; 2

n x

!(n) log log x +

n x

(log log x)2 :

n x

X
n x n 0 (mod p)

For the rst term, we take advantage of the estimate we just made to obtain X X X 2 X XX 1 !(n)2 = 1 = n x pn qn n x n x pn XX XX XX = 1+ 1= 1 + x log log x + O(x):
j j j

Xx + O(x) = x(log log x + O(1)) + O(x) = x log log x + O(x): p xp

p x

1=

X x p x p

n x p=q pq n
6 j

n x pn
j

n x p=q pq n
6 j

37

We proceed by observing that XX XX X x X x X x X x 1= 1= = + O ( x ) = ; 2 + O(x): pq pq pq p n x p=q pq x p=q n x p=q p=q p x


pq n
j 6

pq x pq n
j

pq x

pq x

Theorem 31 imlies that each of the sums (log log x)2 +O(log log x) = Also,

X
p

(1=p) and

X
p x

(1=p) is log log x + O(1) so that

X 1 p p x
p

X 1 pq x pq

X1 2 = (log log x)2 +O(log log x): p p x X


1

X
p
p

deduce that

(1=p2 ) = O(1)

since

X
p

(1=p2 )

converges (by comparison with

X
n x

n=1

(1=n2 )). We

!(n)2 = x(log log x)2 + O(x log log x):

Combining the above information, we obtain X; !(n) ; log log x 2 = O(x(log log x)):
n x

there exist " > 0 and > 0 such that there are arbitrarily large values of x for which the number of positive integers n x satisfying () is > x. If x1=e < n x, then log log x log log n > log log(x1=e ) = log log x ; 1: If, in addition, n satis es ( ), then
j! (n) ; log log xj > j! (n) ; log log nj ; 1 j! (n) ; log log nj

Proof of Theorem 32. Assume !(n) does not have normal order log log n. Then
" log log n

" log log n ; 1 > " log log x ; (1 + "):

In particular,

We consider x satisfying ( ) for > x positive integers n x with x su ciently large so that " log log x > 1 + " and x1=e < x: 2 2

" log log x: " log log x ; (1 + ") > 2

38

We deduce that there are > x ; x1=e > ( =2)x positive integers n 2 (x1=e x] for which " j! (n) ; log log xj > log log x: 2 Hence, 2 X; " "2 x(log log x)2 : 2 !(n) ; log log x x log log x 2 2 8 Observe that we can nd x arbitrarily large satisfying this inequality. We obtain a contradiction to the lemma since it implies that there is a constant C > 0 for which X; !(n) ; log log x 2 Cx log log x
n x n x

for all x su ciently large.

Homework:

(1) Prove that for every " > 0, there is a constant C (") > 0 such that the number of positive integers n x for which (1 ; ") log log n < !(n) < (1 + ") log log n does not hold is C (")x= log log x for all x su ciently large. (2) Let f : + ! + and suppose that f (n) has normal order log log n. Prove or disprove that the average value of f (n) for n x is asymptotic to log log x. More speci cally, prove or disprove that 1 X f (n) log log x: xn x
Z R

(Comment: In the proof of the lemma in this section, we showed a result that is even stronger than this in the case that f (n) = !(n).) Background. Let (x) denote the number of primes x. Chebyshev's Theorem asserts that for all x su ciently large x < (x) < 1:11 x : 0:92 log x log x He used his result to give the rst proof of Bertrand's Hypothesis that for every x 1 there is a prime in the interval (x 2x]. More speci cally, the above implies that there is an x0 such that if x x0 , then 2x ; 1:11 x > 0: (2x) ; (x) > 0:92 log(2 x) log x

Chebyshev's Theorem:

39

Combining such an estimate with knowledge of a speci c x0 and computations verifying Bertrand's Hypothesis for x < x0 , a proof of Bertrand's Hypothesis follows. Similar work by others has been obtained. In particular, Ramanujan gave an argument for Bertrand's Hypothesis and noted that there are at least 5 primes in (x 2x] for x 20:5. Our next theorem is a variation of Chebyshev's Theorem. The proof below is due to Erd} os. Theorem 33. If n is a su ciently large positive integer, then 1 n < (n) < 3 n : 6 log n log n

Proof. Let m be a positive integer. We begin with the inequalities


2m < 4m : m The rst of these inequalities follows from noting that one can choose m objects from a collection of 2m objects by rst randomly deciding whether each of the rst m objects is to be included in the choice or not. The second inequality follows from 2m
2m X 2m m 2 m 4 = (1 + 1) = j =0 j

m : > 2m

From the above inequalities, we deduce that ()

m log 2 log((2m)!) ; 2 log(m!) < m log 4:


1

We use that if p is a prime and pr jjk!, then r = k=p] + k=p2 ] + . Therefore, X X 2m m log p: ( ) log((2m)!) ; 2 log(m!) = ;2 j j p p p j =1 It is easy to verify that 2x] ; 2 x] 2 f0 1g for every real number x. Hence, ( ) and ( ) imply X X X m log 2 1 log p log(2m) = (2m) log(2m):
p 2m 1 j log(2m)= log p p 2m

Thus, if n = 2m, then Also, if n = 2m + 1, then (n)

(n)

log 2 n > 1 n : 2 log n 4 log n 1 2m 2m + 1 4 2m + 1 log(2m + 1) 1 n : 6 log n

2m (2m) > 1 4 log(2m)

40

This establishes the lower bound in the theorem (for all positive integers n). For the upper bound, we use that if m < p 2m, then 2m=p] ; 2 m=p] = 1. Thus, ( ) and ( ) imply X 2m ; 2 m log p m log 4 p p m<p 2m X X ; log p log m = (2m) ; (m) log m:
m<p 2m m<p 2m

m : (2m) ; (m) (log 4) log m We consider positive integers r and s satisfying 2r n < 2r+1 and 2s n19=20 < 2s+1 . Observe that s tends to in nity with n. Taking m = 2j above, we deduce 2j 2j (log 4) for j 2 fs s + 1 : : : rg: (2j +1 ) ; (2j ) (log 4) log(2 j) log(2s ) Summing over j , we obtain ; ; r+1 ; log 4 2s + 2s+1 + + 2r (n); n19=20 2 ; 2s log(2s ) (log 4)2r+1 2(log 4)n = 2(log 4)n s + 1 1 s log(2 ) s log 2 s (s + 1) log 2 1 ; 119=20 = 40 log 4 s + 1 n < 2:92 s + 1 n : 2(log 4)n s + s log n 19 s log n s log n For n and, hence, s su ciently large, we deduce n + ;n19=20 2:95 n + n19=20 = 2:95 + log n n < 3 n (n) < 2:95 log n log n log n n1=20 log n completing the proof.

Hence,

The Prime Number Theorem and Its Generalizations:

The Prime Number Theorem asserts that (x) x= log x. Observe that this is stronger than Chebyshev's theorem. In this section, we mention some theorems without proving them. The rst two are variations of the Prime Number Theorem. x +O x . Theorem 34. (x) = log x log2 x Z x dt De nition and Notation. We de ne the logarithmic integral of x by Li(x) = log t . 2 This varies slightly (by a constant) from historic de nitions of the logarithmic integral, but the results below will not be a ected by this change.

41

implied constant depends on k. Theorem 35 implies Theorem 34 and more. Using integration by parts and the estimate

Theorem 35. For every k > 0, we have (x) = Li(x) + O


Z

x where the logk x

()

dt log4 t

x log4 x

explain why Theorem 35 implies x + x + 2x + O x : (x) = log x log2 x log3 x log4 x Dirichlet's Theorem asserts that if a and b are positive relatively prime integers, then there are in nitely many primes of the form a + bn. Set (x b a) = jfp x : p a (mod b)gj: Then a strong variation of Dirichlet's Theorem is the following. Theorem 36. If a and b are positive relatively prime integers and k > 0, then 1 Li(x) + O x (x b a) = ( b) logk x where the implied constant depends only on k and b.

Homework:

x x . Determine with proof (2) There is a constant A such that (x) ; (log x )+A log3 x the value of A. X 1 (3) (a) Let and be positive real numbers. Prove that = log( = ) + O(1= ). <n n (b) Let S = fm1 m2 : : : g where m1 m2 : : : are integers satisfying 0 < m1 < m2 < . De ne S (x) = jfm x : m 2 S gj (so S (x) is the number of elements in S which are x). X 1 Suppose that m converges. Prove that almost all integers are not in S . In other
1

(1) Prove ( ).

S (x) = 0: lim x x X 1 1 . (Alternatively, one can use (c) Use Theorem 33 to show that log x x<p 20x p Theorem 31, but Theorem 33 is simpler.)
!1

words, show that

j =1

42

(d) Let T = fp1 p2 : : : g where p1 p2 : : : are primes satisfying p1 < p2 < . De ne X T (x) = jfp x : p 2 T gj. Suppose that p1 converges. Is it necessarily true that
1

j =1 j

T (x) = 0 lim x (x)


!1

(i.e., that almost all primes are not in T )?

Riemann-Stieltjes Integrals:
;

De nitions and Notations. Suppose f : a b] 7! . Let P = fx0 x1 : : : xn g denote a partition of a b] with a = x0 < x1 < < xn 1 < xn = b. Let M (P ) = 1max fx ; x g. k n k k 1 Let tk 2 xk 1 xk ] for k 2 f1 2 : : : ng. Consider
R
; ;

S (P f ftk g) =

n X k=1

f (tk )(xk ; xk 1 ):
;

If S (P f ftk g) tends to a limit A (independent of the tk ) as M (P ) tends to zero, then we write Zb f (x) dx = A and say that the Riemann integral of f (x) on a b] exists and equals A. Let g : a b] 7! . With the notations above, we set
R

S (P f g ftk g) =

n X k=1

; f (tk ) g(xk ) ; g(xk 1 ) :


;

If S (P f g ftk g) tends to a limit A (independent of the tk ) as M (P ) tends to zero, then we write Zb f (x) dg(x) = A and say that the Riemann-Stieltjes integral of f (x) with respect to g(x) on a b] exists and equals A. Comments: The properties of Riemann integrals and Riemann-Stieltjes integrals are very similar. Note in fact that if g(x) = x, then the de nitions coincide. If g(x) is di erentiable on a b], then one can show Zb Zb f (x) dg(x) = f (x)g (x) dx:
0

We will mainly be interested in the case when g(x) is a step function.

43

Zx1 x] X 1. Example: t d t] = n 1 n=2 We will make use of an integration by parts formula for Riemann-Stieltjes integrals. For a proof of this and other properties of Riemann-Stieltjes integrals (de ned somewhat di erently), see the instructor's notes at: http://www.math.sc.edu/~filaseta/courses/Math555/Math555.html Zb Zb Lemma: If g(x) df (x) exists, then so does f (x) dg(x) and Z Zb Zb b f (x) dg(x) = f (x)g(x) a ; g(x) df (x) = f (b)g(b) ; f (a)g(a) ; g(x) df (x): a a a
b a a

We obtain Zx Z x t] Zx1 x ] 1] d t] = x ; 1 ; t] d(1=t) = t2 dt + O(1=x) 1 1 t Z1 Z x ftg Z x1 x t ; t] dt ; = t2 dt + O(1=x) = log x ; 1 t2 dt + O(1=x): 1 t 1 Zx1 Z ftg Z x ftg 1 dt dt = 1 ; x . It follows that dt exists. Also, Observe that 1 t2 1 t2 1 t2 Z ftg Z 1 1: dt dt = 2 2 x x t x t Combining the above, we deduce Z 1 Z 1 Z 1 Zx1 d t] = log x ; dt + dt + O(1=x) = log x ; dt + O(1=x): 1 t2 x t2 1 t2 1 t From the previous example, we obtain Z 1 X1 = log x + + O(1=x) where =1; dt = 0:5772157 : : : : 1 t2 n xn
1 1 1 1 1 1 1

Example: We apply integration by parts to the integral in the previous example.

More precisely, the analysis above gives X1 = log x + + E (x) where n xn


;

ftg E (x) = ; x + dt: x t2


1

fxg

Recall that this last integral is 1=x so that we can deduce jE (x; )j 1=x. Thus, for examX 6 1=n can be computed to within 10 by considering log 106 + = 14:392726 : : : . ple,
n 106

44

not is irrational.

Comment: The constant is called Euler's constant. It is unknown whether or

We combine the lemma from the previous section with the Prime Number Theorem to arrive at improvements to some earlier results. Theorem 37: There exist constants C1 , C2 , and C3 such that X1 1 , (i) = log log x + C + O 1 log x p xp X log p 1 , and (ii) = log x + C + O 2 log x p x p Y C3 . (iii) 1; 1 p log x p x Proof of parts (i) and (iii): For (i), we use integration by parts and Chebyshev's Theorem to obtain Z x (t) Zx 1 X1 Z x1 ( x ) 1 = d (t) = x + 2 dt = O log x + 2 t log t dt + C1 (x) p t t 1 1 p x where

Sums and Products of Primes Revisited:

Zx1 t dt: C1 (x) = t2 (t) ; log t 2 By a previous homework problem and Theorem 34, Zx 1 Zx1 t (t) ; log t dt 2 dt 2 t log t 2 t2
It follows that

1:

Z
2

exists. Also, observe that Z 1 t dt ( t ) ; 2 log t x t


1

1 t2

t dt = lim C (x) (t) ; log 1 x t


!1

1 dt x t log2 t
1 1

1 : log x

Hence,

C1 (x) =
=

Z Z2
2

1 t2 1 t2

Z t (t) ; log t dt ; x t dt + O (t) ; log t

1 (t) ; t dt t2 log t 1 : log x

45

Since we obtain (i) with

Z
2

1 dt = log log x ; log log 2 t log t


1

1 (t) ; t dt ; log log 2: log t 2 t2 For (iii), we argue along the lines of the proofs of Theorem 28 and 31. Note that Y X 1 = ; X X 1 = ; X 1 ; C (x) log 1; 1 = log 1 ; 3 k p p p x p x p x k=1 kp p xp

C1 =

where

XX 1 C3 (x) = k p x k=2 kp
1 !1 1

XX 1 X 1 k = p x k=2 p p x p(p ; 1)
1

2 n x n(n ; 1)

1:

We deduce that xlim C3 (x) exists. Also,

XX 1 k p>x k=2 kp
It follows that

1 = x] ; 1 n>x n(n ; 1)
1 1

1: x

C3 (x) =

XX 1 XX 1 XX 1 1 : ; = + O k k k x p>x k=2 kp p k=2 kp p k=2 kp


1 1

We deduce from (i) that Y XX 1 1 = ; log log x ; C + O 1 log 1; 1 = ; log log x ; C1 ; + O k p log x log x p k=2 kp p x

XX 1 where C = C1 + k . We obtain p k=2 kp


1

1 = e C +O(1= log x) 1; p log x p x


;

C3 log x

Comments: The proof of (ii) is omitted (but note the related problem in the next homework). The constants in Theorem 37 are
C1 = 0:261497212847643 : : : C2 = ;1:33258 : : :
and

where C3 = e C .
;

C3 = 0:561459 : : : :

46

Also, the number C in the argument above can be shown to be Euler's constant. Ignoring the big-oh term in (i), it is not hard to see that if one could print a million primes per second, then it would take over 1000 years to print enough primes (assumed distinct) to make the sum of their reciprocals exceed 4. A more rigorous estimate is possible (where the error term is not ignored). For the problems below, you are to make use of Theorems 34, 35, and 36 as well as Riemann-Stieltjes integrals. X log p (1) Prove that = log x + O(1). p p x X x : (2) Prove that log p = x + O log x p x

Homework:

(3) Let a and b be positive integers with gcd(a b) = 1: Prove that

X
p x p a (mod b)

1 p

1 log log x: (b)

(4) Let pn denote the nth prime. Prove that pn n log n: (5) Prove that there are in nitely many primes which begin and end with the digit 9. More speci cally, show that there are in nitely many primes which can be written in the r X form dk 10k where dr = d0 = 9 and dk 2 f0 1 2 : : : 9g for each k.
k=0

De nitions. Let P (x) denote the number of positive integers x having a property P . Then we say that a positive proportion of the positive integers satis es P if there is a constant C > 0 such that P (x) > Cx for all su ciently large x. If there is a constant C 0 for which P (x) Cx, then we say the proportion of positive integers satisfying P is C . If this proportion is 1, then we say that almost all positive integers satisfy P . Examples. Almost all positive integers are composite. It follows as a consequence p of our next result that the proportion of positive integers n having a prime factor > n is log 2. Theorem 38. The number of positive integers n x having a prime factor > pn is (log 2)x + O x . log x

Integers With Large Prime Factors:

47

Proof. The desired quantity is


X X
p j

n x n<p n pn

1=

X X
j

X
p

p x n x n<p pn

1=

X X
p
p

(p ; 1) ;

x = O;px (px) + X x + O( (x)): p p x<p x x<p x


p

x n<p pn
j

1;

X X
p

x<p x n x pn
j

Chebyshev's Theorem implies that the error terms (the big-oh terms) are both O(x= log x). Theorem 37 (i) implies X 1 p 1 = log 2 + O 1 : = log log x ; log log x + O p log x log x x<p x
p

The theorem follows.

The Sieve of Eratosthenes:

We begin by illustrating the approach with an easy consequence of Theorem 33. It should be noted that some similarities exist with the argument below and the sieve proof given for Theorem 15. Theorem 39. (x) = o(x). Proof. The number of positive integers x divisible by a product of primes p1 p2 : : : pr is x=(p1 p2 : : : pr )]. The inclusion-exclusion principal implies that the number of positive integers n x with each prime factor of n being greater than z is X X x x ; X x + + x] ; p1 <p2 z p1 p2 p1 <p2<p3 z p1 p2 p3 p z p X X x X X =x; x + ; + O 1 + 1 + 1+ p p p 1 2 p z p1 <p2 z p z p1 <p2 z Y 1 + O (z ) + (z ) + (z ) + : =x 1; p 0 1 2 p z The big-oh term is that 2 (z ) 2z . We take z = log x and use Theorem 37 (iii) to deduce Y x : 1 x 1; p log log x p z

Also, this choice of z gives 2z = xlog 2 . We obtain that the number of positive integers n x with each prime factor of n being greater than log x is o(x). This accounts for all the primes x except those which are log x. There are clearly o(x) such primes and the result follows.

48

A closer look at the argument. We estimated (x) using the inequality

A(z x) = jfn x : pjn =) p > z gj (so that A(z x) denotes the number of positive integers x having each of its prime divisors > z ). We used that X X x x ; X x + : A(z x) = x] ; + p z p p1 <p2 z p1 p2 p1 <p2 <p3 z p1 p2 p3
where This last identity can be justi ed as follows. For n a positive integer, de ne X X X (n) = 1 ; 1 + 1; 1+ :
p z pn
j

(x) z + A(z x)

p1 <p2 z p1 p2 n
j

p1 <p2 <p3 z p1 p2 p3 n
j

e1 qe2 qer m where r is a non-negative integer, q1 : : : qr are Write n in the form n = q1 r 2 distinct primes z , m e1 : : : er are positive integers, and every prime divisor of m is > z . If r = 0, then clearly (n) = 1. If r > 0, then r + r ; r = (1 ; 1)r = 0: (n) = 1 ; 1 2 r Thus, we deduce that 1 if every prime divisor of n is > z (n) = 0 otherwise: Hence, X X X X A(z x) = (n) = 1; 1+ 1; n x

n x

1;

XX
j

n x

x ; X x + : z p1 p2 p1 <p2 <p3 z p1 p2 p3 We will modify our choice for (n) slightly for other applications. The basic approach we used to estimate A(z x) is called the sieve of Eratosthenes. We give two more examples. Theorem 40. The number of squarefree numbers x is asymptotic to (6= 2 )x. Proof. We make use of the identity Y () 1 ; p12 = 62 : p

X x X = x] ; + p z p p1 <p2

p zn x pn

1+

p z pn
j

X
j

p1 <p2 z p1 p2 n
j

p1 <p2 z n x p1 p2 n

1;

49

One can obtain ( ) from Y 1 ; p12 p

Y
p

1 + p12 + p14 +

2 X1 = : 2 n 6 n=1
1

Denote by A1 (z x) the number of n x that are not divisible by p2 for every p z . Let A2 (z x) denote the number of such n that are not squarefree. In other words,

A1 (z x) = jfn x : p2 jn =) p > z gj
and

A2 (z x) = jfn x : p2 jn =) p > z 9p such that p2 jngj: By the sieve of Eratosthenes, X X X A1 (z x) = 1; 1+ 1;


n x

= x] ;

X x X + 2 p z p p1 <p2

p z p2 n
j

p1 <p 2 z 2 p2 1 p2 n
j

x 2 2 z p1 p2

=x

Y
p z

; 1 ; p12 + O 2 (z) :

Taking z = log x, we obtain Y Y ; ; 1 ; p12 + o x : A1 (z x) = x 1 ; p12 + O 2log x = x p log x p log x Thus, A1 (z x) (6= 2 )x (with z = log x). Since the number of squarefree numbers is A1 (z x) ; A2 (z x), it su ces to show A2 (z x) = o(x). We use that X1 XX XX X x x A2 (z x) 1= 1= p2 p2 :
n x p>z p2 n
j

p>z n x p2 n
j

p>z

p>z

A2 (z x) = o(x), completing the proof. X Comment: Let (k) = n1k . An argument similar to the above shows that for k=1 every integer k > 1, the number of k-free numbers x is asymptotic to x= (k). Theorem 41. Let T be a set of positive integers with the property that for every odd prime p, every su ciently large multiple of p is in T . In other words, T is such that if p is
1

X1 X1 X1 converges by comparison with . Since z = log x and The series 2 2 2 p>z p p p n=1 n X1 is the tail end of a convergent series, we deduce that p2 = o(1). It follows that
1

p>z

50

an odd prime, then there is a k0 (p) for which kp 2 T for every positive integer k k0 (p). De ne T (x) as the number of elements of T that are x. Then T (x) x. Comments. It will follow from the proof that X the existence of k0 (p) only needs to hold for a set of primes P having the property that (1=p) diverges. Theorem 41 is

The upper bound is obvious. For z > 0, de ne K = K (z ) = maxfk0 (p) : 2 < p z g. Then for each prime p z and each integer k K , we have kp 2 T . Let S = fn 2 + : n 62 T g, and de ne S (x) = jfn x : n 2 S gj. Thus,
Z

connected to Fermat's Last Theorem. Explain this connection. Proof. Fix " > 0. It su ces to show that there is an x0 (") such that if x x0 ("), then x) 1: 1 ; " T( x

2P

S (x) = x] ; T (x):
For each z > 0 and each odd prime p z , there are K = K (z ) multiples of p in S. The remaining elements of S are not multiples of any odd prime p z . In other words, the remaining elements of S have all their odd prime factors > z . Thus, X S (x) K + A(z x) where A(z x) = jfn x : pjn =) p = 2 or p > z gj:
p z

Now,

A(z x) =

X
n x

1;

X
2<p z

1+

X
j

p1 p2 n Y Y ; (z ) 1 + O;2z + O 2 = 2 x 1 ; =x 1; 1 p p 2<p z p z
j

pn

2<p1 <p2 z

1;

= x] ;

X X x + 2<p z p 2<p1<p2
:

x z p1 p2

Taking z = e4=" and using the lemma to Theorem 28, we deduce that 2x + O;2z S (x) K (z ) + A(z x) Kz + log z

" x + O;2e4=" = " x + O(1) Ke4=" + 2 2

where the implied constant depends on " and K (but note that K only depends on "). For x su ciently large, we obtain S (x) "x ; 1 so that

T (x) = x] ; S (x) x ; 1 ; ("x ; 1) = (1 ; ")x:


This completes the proof.

51

Homework:
(1) (a) Let P be a set of primes for which

X
p
2P

(1=p) diverges. Explain why

diverges. (b) Given the set P in (a), explain why zlim

log 1 ; 1 p p
2P

Y
p zp
2P

!1

(c) Justify the rst comment made after the statement of Theorem 41. (2) (a) For z > 1, de ne X X X (n) = 1 ; 1+ 1; 1+
p z p 3 (mod 4) pn
j

1 = 0. 1; p

p1 <p2 z p1 p2 3 (mod 4) p1 p2 n
j

p1 <p2<p3 z p1 p2 p3 3 (mod 4) p1 p2 p3 n
j

Prove that (n) = 1 if x2 +1 0 (mod n) has a solution and that (n) 0 for all positive integers n. (b) Use a sieve argument to show that for almost all positive integers n, x2 + 1 0 (mod n) does not have a solution. In other words, show that the number of n x for which x2 + 1 0 (mod n) has a solution is o(x).

The Pure Brun Sieve:

The idea. The sieve of Eratosthenes was based on estimating

X
n x

(n) where (n)

is something like (depending on the application) X X (n) = 1 ; 1 + 1;


p z pn
j

X
p1 <p2 <p3 z p1 p2 p3 n
j

p1 <p2 z p1 p2 n
j

1+

One major goal of sieve methods is to take z as large as possible without causing the error terms that arise to exceed what one expects the main term ; to be. In the sieve of Eratosthenes, we took z = log x which caused the error term O 2z not to be too large. The choice of (n) above has the property that 1 if every prime divisor of n is > z (n) = 0 otherwise P so that jfn x : pjn =) p > z gj = n x (n). We x a positive integer k and de ne a new quantity X X X (n) = 1 ; 1 + 1; + 1:
0

We will show that ()

p z pn
j

p1 <p2 z p1 p2 n
j

p1 <p2 < <p2k z p1 p2 p2k n


j 0

jfn

x : pjn =) p > z gj

X
n x

(n):

52

The advantage of using (n) over (n) can be seen as follows. Recall that in using (n), we were led to considering sums of expressions of the form x=(p1 p2 pr )] where the pj denoted primes satisfying p1 < p2 < < pr z . In that approach, we then replaced this expression with x=(p1 p2 pr ) + O(1). We can see immediately that this is too wasteful if r (and, hence, large. For example, if z = (log x)2 and r = (z ) are Y z ) is large, then p1 p2 pr = p ez=2 = x(log x)=2 is so large that x=(p1 p2 pr )] = 0 and
0

x=(p1 p2 pr )] is very close to the value of x=(p1 p2 pr ). Our method used an error of O(1) when in fact the true error was much smaller. By limiting the number of primes one considers as in the de nition of (n), one can better control the lost made by omitting the greatest integer function. This in turn allows us to choose z larger than before. In particular, in the application we describe shortly, we will take z = x1=(24 log log x) . Comments: A lower bound similar to the upper bound given in ( ) can be obtained by considering 2k + 1 instead of 2k primes in the de nition of (n). Further sieve methods, due independently to Brun and Selberg, allow one to take z even larger than that mentioned above. Typically, one can z = xc where c is a positive constant depending on the application. A property of (n). We show that (n) = 1 if every prime divisor of n is > z and that (n) 0 for all n. Observe that ( ) follows as a consequence. The rst part is obvious for if every prime factor of n is > z , then all the sums in the de nition of (n) are e1 qe2 qer m empty and only the term 1 is non-zero in this de nition. Now, suppose n = q1 r 2 where the qj are distinct primes z , each of r e1 : : : er are positive integers, and every prime factor of m is > z . It follows that
0 0 0 0 0 0

p z

( )

; where we interpret a (i) b as 0 is b > a. To show that (n) 0, consider three cases: r r 2k, (ii) 2k < r 4k, and (iii) r > 4k. Case (i) is dealt with by using (1 ; 1) = 0 to show (n) = 0. For Case (ii), use (1 ; 1)r = 0 to obtain
0 0 0

r + r (n) = 1 ; 1 2

+ 2rk

r + (n) = 2k r ; +1 2k + 2 r ; r 2k + 1 2k + 2 +
0

r r r 2k + 3
;

r 2k + 4

0:

For Case (iii), use ( ) directly to show that (n) 1 (by again grouping the binomial coe cients in pairs). An estimate concerning twin primes. A twin prime is a prime p for which p ; 2 or p + 2 is also prime. Thus, 3, 5, 7, 11, 13, 17, 19, 29, and 31 are all twin primes. We denote the number of twin primes x by 2 (x). We will show Theorem 42. 2 (x) logx2 x (log log x)2 .

53

More generally, we denote by a (x) the number of primes p x for which p ; a or p + a is also prime. We prove our next theorem from which Theorem 42 follows. Theorem 43. Let a be a positive integer. Then a(x) logx2 x (log log x)2 where the implied constant depends on a. Proof. We de ne

A (z x) = jfn x : pjn(n + a) =) p > z gj:


0

Observe that for z su ciently large (eg., z 2a + 2 so that (z ) + a a (x) 2A (z x) + z . We seek a good estimate for A (z x). We use that X A (z x) (n(n + a))
0 0 0 0

z ), we have

n x

n x
;

1;

X X
p z n x p n(n+a)
j

1+

X
p1 <p2 z

X X
j

n x p1 p2 n(n+a)
j

p1 <p2 < <p2k z

n x p1 p2 p2k n(n+a)

1:

We x momentarily z a so that if pja, then p z . For a given p z , we consider two possibilities, pja and p a. If pja, then the number of n x for which pjn(n + a) is x=p], which is within 1 of x=p. If p a, then the number of n x for which pjn(n + a) is within 2 of 2x=p. In general, if p1 : : : pu are distinct primes dividing a and pu+1 : : : pu+v are distinct primes not dividing a, then;the number of n x for which n(n + a) is divisible by p1 p2 pu+v is within 2v of 2v x= p1 p2 pu+v (this can be seen by using the Chinese Remainder Theorem and considering the number of such n in a complete system of residues modulo p1 p2 pu+v ). It follows that X X 2x X x A (z x) x ; x ; + p z p p z p p1 <p2 z p1 p2
0

+
;

2x + X 2x + X 4x p1 <p2 z p1 p2 p1 <p2 z p1 p2 p1 <p2 z p1 p2

pa
j

p-a

p1 p2 a
j

p1 a p2 -a
j

2k x 2 + + E1 p1 <p2 < <p2k z p1 p2k

p1 -a p2 a
j

p1 -a p2 -a

Y
j

1 Y 1; 2 x+E +E 1; p 1 2 p p z pa
p-a

p1 -a ::: p2k -a

54

where

z ) + 4 (z ) + + 22k (z ) E1 1 + 2 ( 1 2 2k 2 22k 2 (z )2k (z )2k 1 + 2 + 2 + + e 2! (2k)!

and

for z su ciently large. We also have E1 e2 (z )2k z 12 log log z for z su ciently large. We now choose z = x1=(24 log log x) and consider x su ciently large to deduce that Y 1 Y 1; 2 x+E A (z x) 1; p p p z pa
0 j

2k+1 x 2k+2 x X 2 2 E2 + + p1 <p2 < <p2k+1 z p1 p2 p2k+1 p1 <p2 < <p2k+2 z p1 p2 p2k+2 X 1 X2 u X 1; u x x 2 log log z + 2 C 1 u=2k+1 u! p z p u=2k+1 u! P where C1 is some appropriate constant. Using eu = j =0 uj =j ! uu =u! and choosing k = 6 log log z ], we obtain X 2e log log z + 2eC1 u X 1 u x x E2 x x = < u 22k (log z )6 u=2k+1 u=2k+1 2
1 1 1 1 1

where jE j x=(log x)5 . Observe that, for some constants C2 and C3 depending on a, !2 Y Y Y 1 2 1 x (log log x)2 : 1; p 1 ; p x C2 x 1; p C3 (log x)2
pa
j

p-a

p z p-a

p z

Theorem 43 follows. Brun's Theorem. Brun introduced his pure sieve and used it to establish X Theorem 44. (1=p) converges.

Proof. We use Riemann-Stieltjes integrals to obtain


X
p x p a twin prime

p a twin prime

1 = Z x 1 d (t) = 2 (x) + Z x 2 (t) dt: p 1 t 2 x 2 t2

55

Clearly, 2 (x)=x 1. Also, Theorem 43 implies


2 (t) t2

(log log t)2 t(log t)2

1 t(log t)3=2 1:

so that Thus,

1 is a bounded in nite series with positive terms. The theorem follows. p a twin prime p

Z x ( t) 2 dt 2 t2

Zx
2

1 t(log t)3=2 dt

Homework:

(1) Let pn denote the nth prime. (a) Explain why the Prime Number Theorem implies that lim sup(pn+1 ; pn ) = 1. n (b) Use Theorem 43 to prove that for every positive integer k, ; lim sup minfpn+1 ; pn pn+2 ; pn+1 : : : pn+k ; pn+k 1 g = 1:
!1

!1

(Note that this would follow from part (a) if \min" were replaced by \max" the problem is to gure out how to handle the \min" situation.)

You might also like