Math 314 Course Notes: Brief description

Similar documents
Summary Slides for MATH 342 June 25, 2018

Part II. Number Theory. Year

LECTURE 4: CHINESE REMAINDER THEOREM AND MULTIPLICATIVE FUNCTIONS

Introduction to Number Theory

Elementary Number Theory Review. Franz Luef

2 More on Congruences

Elementary Number Theory MARUCO. Summer, 2018

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Theory of Numbers Problems

Lecture 4: Number theory

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

Math 118: Advanced Number Theory. Samit Dasgupta and Gary Kirby

SOLUTIONS TO PROBLEM SET 1. Section = 2 3, 1. n n + 1. k(k + 1) k=1 k(k + 1) + 1 (n + 1)(n + 2) n + 2,

A SURVEY OF PRIMALITY TESTS

a = mq + r where 0 r m 1.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

0 Sets and Induction. Sets

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

M381 Number Theory 2004 Page 1

ASSIGNMENT Use mathematical induction to show that the sum of the cubes of three consecutive non-negative integers is divisible by 9.

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

A Readable Introduction to Real Mathematics

I Foundations Of Divisibility And Congruence 1

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

4 PRIMITIVE ROOTS Order and Primitive Roots The Index Existence of primitive roots for prime modulus...

Introduction to Abstract Mathematics

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

ECEN 5022 Cryptography

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Contest Number Theory

Number Theory Proof Portfolio

Smol Results on the Möbius Function

Number Theory Marathon. Mario Ynocente Castro, National University of Engineering, Peru

A Guide to Arithmetic

Mathematics for Cryptography

Numbers and their divisors

MATH FINAL EXAM REVIEW HINTS

Math 324, Fall 2011 Assignment 6 Solutions

Number Theory Marathon. Mario Ynocente Castro, National University of Engineering, Peru

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

LECTURE NOTES IN CRYPTOGRAPHY

Part IA Numbers and Sets

Number Theory in Problem Solving. Konrad Pilch

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

1. multiplication is commutative and associative;

Objective Type Questions

Divisibility. 1.1 Foundations

Basic elements of number theory

Basic elements of number theory

Math 324, Fall 2011 Assignment 7 Solutions. 1 (ab) γ = a γ b γ mod n.

Elementary Properties of the Integers

Public-key Cryptography: Theory and Practice

Math 4400/6400 Homework #8 solutions. 1. Let P be an odd integer (not necessarily prime). Show that modulo 2,

Solutions to Problem Set 4 - Fall 2008 Due Tuesday, Oct. 7 at 1:00

1 Overview and revision

PRIME NUMBERS YANKI LEKILI

Part IA. Numbers and Sets. Year


A FIRST COURSE IN NUMBER THEORY

CONTINUED FRACTIONS, PELL S EQUATION, AND TRANSCENDENTAL NUMBERS

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Introduction to Information Security

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Mathematics 4: Number Theory Problem Sheet 3. Workshop 26 Oct 2012

1 Basic Combinatorics

18.785: Analytic Number Theory, MIT, spring 2006 (K.S. Kedlaya) Dirichlet series and arithmetic functions

MATH 361: NUMBER THEORY FOURTH LECTURE

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Topics in Number Theory

Chapter 5. Number Theory. 5.1 Base b representations

Divisibility. Chapter Divisors and Residues

The Chinese Remainder Theorem

Predictive criteria for the representation of primes by binary quadratic forms

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

A Few Primality Testing Algorithms

Mathematical Reasoning & Proofs

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Number Theory and Algebra: A Brief Introduction

Winter Camp 2009 Number Theory Tips and Tricks

THESIS. Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

NOTES ON FINITE FIELDS

Chapter 8. P-adic numbers. 8.1 Absolute values

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition. Todd Cochrane

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

Analytic Number Theory Solutions

Prime Numbers and Irrational Numbers

Basic Algebra. Final Version, August, 2006 For Publication by Birkhäuser Boston Along with a Companion Volume Advanced Algebra In the Series

Homework #2 solutions Due: June 15, 2012

Number theory lectures

Beautiful Mathematics

MATH 310: Homework 7

Euler s, Fermat s and Wilson s Theorems

Math Review. for the Quantitative Reasoning measure of the GRE General Test

Finite Fields and Error-Correcting Codes

Course 2316 Sample Paper 1

Transcription:

Brief description These are notes for Math 34, an introductory course in elementary number theory Students are advised to go through all sections in detail and attempt all problems These notes will be modified and expanded as the course proceeds i

ii

Contents Math 34 Course Notes: Brief description i Fundamental notions Mathematical Induction Divisibility 3 3 Greatest common divisor and Euclidean algorithm 3 4 Prime numbers and unique factorization 8 Arithmetic Functions Multiplicative Functions Möbius function and Möbius inversion 3 3 Euler s Phi function 5 4 Greatest Integer Function 7 5 The big oh and small oh notations 9 6 Averages of arithmetical functions 0 3 Congruences 5 3 Definition and basic properties 5 3 Congruence powers and Euler s theorem 8 33 Linear congruence equations 30 34 Simultaneous linear congruences and the Chinese Remainder Theorem 33 35 Polynomial congruences 36 36 Order and primitive roots 4 4 Quadratic residues and the quadratic reciprocity law 47 4 Quadratic residues 47 4 Legendre symbol 49 iii

43 Gauss lemma 50 44 The Quadratic Reciprocity Law 53 45 Jacobi symbol 57 5 Sums of squares 6 5 Pythagorean triples 6 5 The equation x 4 + y 4 = z 4 6 53 Sums of two squares 64 54 Sums of four squares: Lagrange s theorem 66 6 Binary Quadratic Forms 69 6 Introduction to binary quadratic forms 69 6 Equivalence 7 63 Reduction of binary quadratic forms and class number 73 64 The representation of a number by a form 77 7 Continued Fractions and Pell s Equation 79 7 Finite continued fractions 79 7 Infinite Continued Fractions 84 73 Purely periodic continued fractions 9 74 Continued fraction expansion for N 97 75 Pell s equation 98

Chapter Fundamental notions Mathematical Induction Throughout these notes, we will denote the set of natural numbers as N and the set of integers as Z We start this section with the following fundamental property of integers, namely the well-ordering principle: Principle [Well-ordering principle] Every non-empty set of nonnegative integers contains a least element The well-known principle of mathematical induction follows from Principle Theorem [Principle of mathematical induction] Let S be a set of positive integers with the properties (a) S (b) If k S, then k + S Then S = N Proof Let T be the set of natural numbers which do not lie in S Let us assume that T is non-empty By Principle, T contains a least element, say t Clearly, t >, since, by (a), S Thus, 0 < t < t Since t is the least element in T, t is not in T and therefore is an element of S But,

CHAPTER FUNDAMENTAL NOTIONS by part (b), if t is an element of S, then so is (t ) + = t, which is a contradiction to the fact that t is an element of T Thus, our assumption is false This proves that T is empty and therefore S = N In the above theorem, (a) is usually called the basis hypothesis and (b) is called the induction hypothesis Remark 3 In some cases, in the basis hypothesis, can be replaced by some other positive integer a In this case, we conclude that S is the set of all integers a For various purposes, we use the induction principle in another form as given below: Theorem 4 [Second principle of induction] Let S be a set of positive integers with the properties (a) S (b) If,, 3, k S, then k + S Then S = N Proof The proof is similar to that of Theorem Let T be the set of natural numbers which do not lie in S and let us assume that T is nonempty Applying the well-ordering principle, let t be the least element in T Thus, t >, that is t > 0 Since t is the least element in T, neither of the elements,, t lie in T Thus,,, t are elements of S and therefore, by induction hypothesis, so is t, which contradicts the fact that t T Thus, our assumption is false and T is empty This proves that S = N Induction is a very strong tool in Mathematics, but one needs to understand when and in what form to use it Exercise 5 Prove that for every natural number n,! +! + nn! = (n + )! Exercise 6 Prove that for any natural number n, [ ] n(n + ) 3 + 3 + n 3 =

DIVISIBILITY 3 Exercise 7 Prove that the cube of any integer can be written as the difference of two squares Exercise 8 Show that a n = (a )( + a + a + a 3 + a n ) [Hint: a n+ = (a + )(a n ) a(a n )] Divisibility Let a, b Z with b 0 We say that b divides a if there exists an integer c such that bc = a Notationally, we write this as b a This is not to be confused with the rational number b/a We shall frequently appeal to the division algorithm, which is stated as follows: Theorem [Division Algorithm] For any a, b Z with b > 0, there exist unique q, r Z such that a = bq + r and 0 r < b We prove this theorem by the following set of exercises: Exercise Consider the set S = {a xb : x Z, and a xb 0} Prove that S is a non-empty set Exercise 3 Use the previous exercise to show that there exists an integer q such that a qb < b Exercise 4 Prove Theorem [Hint: the previous two exercises take care of existence of q and r You now have to show that q and r under the restrictions of the theorem are unique] 3 Greatest common divisor and Euclidean algorithm Definition 3 For non-zero integers a and b, the greatest common divisor of a and b is the largest number that divides both of them

4 CHAPTER FUNDAMENTAL NOTIONS The greatest common divisor of a and b is denoted as gcd (a, b) or (a, b) If (a, b) =, we say that a and b are relatively prime or co-prime It is not too difficult to prove the following lemma: Lemma 3 d = (a, b) if and only if the following conditions hold: (a) d a and d b (b) If e a and e b, then e d How does one find the gcd of two integers? The immediate idea that comes to mind is to factorize a and b and read off the common factors However, this method is not feasible if the numbers involved are big! A more efficient algorithm, known as Euclidean algorithm, involves a successive application of the division algorithm till one hits the zero remainder The general method is described as follows: a = q b + r, 0 r < b b = q r + r, 0 r < r r = q 3 r + r 3, 0 r 3 < r r = q 4 r 3 + r 4, 0 r 4 < r 3 r n 3 = q n r n + r n, 0 r n < r n r n = q n r n + r n, 0 r n < r n r n = q n+ r n + 0 The last nonzero remainder r n is a common divisor of a and b By Lemma 3, in order to prove this, we need to show two things (a) r n a and r n b (b) If d a and d b, then d r n In order to prove (a), we observe that the last line r n = q n+ r n + 0 shows that r n r n Then, the line before the last line shows that r n r n, since it divides both r n and r n Working our way up, step by step, we deduce that r n b and r n a To prove (b), let d a and d b From the first line a = q b + r, we see that d r From the second line, since d b and d r, we see that d r Working our way down till the second last line, we get that d r n Thus, we have proved both conditions (a) and (b) This implies, by Lemma 3, that r n = (a, b) Thus, we have proved the following theorem:

3 GREATEST COMMON DIVISOR AND EUCLIDEAN ALGORITHM5 Theorem 33 [Euclidean algorithm] To compute the gcd of two numbers a and b, taking r = a and r 0 = b, we compute successive quotients and remainders r i = q i+ r i + r i+ for i = 0,,, until r n+ = 0 The last nonzero remainder r n is the gcd of a and b Remark 34 The Euclidean algorithm terminates after a finite number of steps because the successive remainders are decreasing, r 0 > r > r > r 3 The remainders r i are all 0 So, we have a strictly decreasing sequence of non-negative integers, which eventually must reach 0 Exercise 35 Use the Euclidean algorithm to obtain gcd (43, 7), gcd (7, 479), and gcd (543, 9876) Exercise 36 Let a and b be two nonzero integers Consider the set S = {ax + by : ax + by > 0; x, y Z} (a) Show that S must contain a smallest element d (b) By the definition of S and (a), there exist integers x and y for which d = ax + by Prove that d a and d b (c) Finally, prove that d = gcd (a, b) This proves that the smallest positive value of ax + by is the gcd of a and b There is yet another way to prove that there exist integers x and y such that ax + by = (a, b) Observe that ( ) a b = ( ) ( ) ( ) ( ) ( ) q b q q r = 0 r 0 0 r ( ) ( ) ( ) ( ) q q qn rn = 0 0 0 r n ( ) rn = A, r n

6 CHAPTER FUNDAMENTAL NOTIONS where A is some matrix with determinant equal to ± Thus, A is a matrix with integer entries, say ( ) c d A =, x y such that ( ) ( ) c d a = x y b ( rn Thus, there exist integers x and y such that ax + by = r n = (a, b) In practice, how do you find integers x and y for which ax + by = (a, b)? We again work our way through the steps of the Euclidean algorithm as follows: a = q b + r r = a q b, which implies that Similarly, r n ) b = q r + r r = b q r, r = b q (a q b) = q a + ( + q q )b r 3 = r q 3 r = (a q b) q 3 ( q a + ( + q q )b) = ( + q q 3 )a (q + q 3 + q q q 3 )b and so on Finally, as we keep moving down, we get r n = ax + by for some integers x and y We also observe that if x and y are solutions of the above linear equation, then, for any integer k, then a(x + kb) + b(y ka) = r n Thus, the equation ax + by = (a, b) has infinitely many integer solutions in x and y Exercise 37 Find integers x and y such that 95x + 43y = Show that there are infinitely many such integers Exercise 38 Show that if (a, b) = and x 0, y 0 is an integer solution of ax + by =, then all solutions are of the form x = x 0 + bk, y = y 0 ak for an integer k

3 GREATEST COMMON DIVISOR AND EUCLIDEAN ALGORITHM7 Exercise 39 Let d = gcd (a, b) Show that the linear equation ax+by = c has a solution if and only if d c Show, also, that if x 0, y 0 is a particular solution of this equation, then all other solutions are given by for an integer k x = x 0 + b d k, y = y 0 a d k Exercise 30 Find integers x, y, z such that 35x + 55y + 77z = Show that there are infinitely many such integers Exercise 3 Prove that if g, g, are integers >, then every natural number can be expressed uniquely in the form a 0 + a g + a g g + a k g g g k with 0 a j < g j+ Deduce that every natural number can be written in factorial base as a 0 + a! + a! + a k k! with 0 a i i Exercise 3 Let g be a natural number > Show that every natural number can be expressed uniquely in the form with 0 a i < g n = a 0 + a g + a g + a k g k Exercise 33 Let a be a natural number > If d n, then show that a d divides a n Exercise 34 Let a be a natural number greater than Show that (a m, a n ) = a (m,n)

8 CHAPTER FUNDAMENTAL NOTIONS 4 Prime numbers and unique factorization A natural number is said to be a prime number if it does not have any divisors other than and itself In these notes, the letter p will denote a prime number Using induction, we prove the following theorem: Theorem 4 Every integer n > is either a prime number or a product of (not necessarily distinct) prime numbers Proof We use the second principle of induction as stated in Theorem 4 The theorem is clearly true for n = Let us suppose that it is true for every integer < n If n is prime, we are done If not, then it has a divisor not equal to and itself Thus, n = cd for some < c < n and < d < n By induction hypothesis, both c and d are products of prime numbers and therefore, so is n = cd Thus, the theorem is proved by the second principle of induction Theorem 4 If p is a prime and p ab, then p a or p b Proof Suppose p is a prime such that p ab If p does not divide a, then p and a are relatively prime By Exercise 36, there exist integers x and y such that ax+py = Thus, abx+pby = b Since p ab, we have, p (abx+pby) and therefore, p b Exercise 43 If p divides a product a a a n for integers a i, prove that p divides one of the a i s We are now ready to prove the Fundamental Theorem of Arithmetic: Theorem 44 [Fundamental Theorem of Arithmetic] Every integer n can be factored uniquely into a product of primes Remark 45 If n itself is a prime, we consider n to be a product of a single number Rearrangement of prime factors of a number is not a new factorization Thus, while Theorem 4 states that any n can be factorized into a product of primes in some way, the Fundamental Theorem of Arithmetic makes a stronger assertion that n can be factorized into such a product in only one way, up to a rearrangement of factors

4 PRIME NUMBERS AND UNIQUE FACTORIZATION 9 Proof We have already proved the factorization of n into a product of primes in Theorem 4 We are now left with proving uniqueness Let us apply an inductive argument again The theorem is clearly true for n = Let us suppose that it is true for all positive integers k < n Suppose we have n = p p p k = q q q s, where p i s and q j s are primes Thus, p q (q q 3 q s ) By Theorem 4, either p = q or p q q 3 q s By a repeated application of Theorem 4, we see that p = q j, for some j s, say j = Thus, by cancellation, we get p p 3 p k = q q 3 q s Since p p 3 p k < n, by induction hypothesis, we get that for each i k, p i equals q j for some j s This proves the theorem for n and by second principle of induction, for all positive integers Exercise 46 Prove that if n is a composite number, then n has a prime factor not exceeding n Exercise 47 Show that there are infinitely many primes [Hint: Suppose there are only finitely many primes p, p, p n What can you say about the prime factors of N = p p p n +?] Exercise 48 Let p n denote the n-th prime Prove that Deduce that for all n, p n+ p p p n p n n Finally, show that if π(x) denotes the number of primes less than or equal to x, then π(x) log log x for all x Exercise 49 (a) Recall that for any real number a such that a <, ( a) = + a + a + Prove that n x n ( p) p x

0 CHAPTER FUNDAMENTAL NOTIONS (b) Recall also that if a <, then log( a) = a + a + a3 3 + Using this, prove that for any prime p, ( log ) p p p(p ) (c) Deduce that p x ( log ) p p + p x (d) Using the fact that the series n p n p diverges, prove that the series diverges [Hint: Take logarithms of the inequality in (a)] Exercise 40 (a) Let f(t) be a monotonically decreasing, continuous function on [0, ) Prove that for any N, N f(t)dt N n= f(n) N 0 f(t)dt (b) Taking f(t) =, show that for a positive real number x, t+ + log([x] + ) log n x n + log([x]) (c) Deduce that (d) Conclude that log log x log p x p ( n x ) n log log x

Chapter Arithmetic Functions Multiplicative Functions An arithmetic function f : N C is a complex valued function defined on the set of natural numbers An arithmetic function is said to be multiplicative if f(mn) = f(m)f(n) whenever gcd (m, n) = A function is called completely multiplicative if f(mn) = f(m)f(n) for all m, n N Henceforth, n will denote a natural number unless otherwise specified Also, a divisor of n will refer to a positive divisor of n Examples function f(n) = for all n N is a completely multiplicative For a fixed a N, the function f(n) = n a is completely multiplicative Let ν(n) denote the number of distinct prime divisors of n ν(n) is not a multiplicative function However, the function f(n) = ( ) ν(n) is a multiplicative function, but not completely multiplicative We now state and prove an important theorem which helps us to construct new multiplicative functions out of existing ones Theorem If f is a multiplicative function, then the function g defined by g(n) := f(d) d n

CHAPTER ARITHMETIC FUNCTIONS is also multiplicative Here the sum runs over all divisors of n Moreover, if n = p a n p a is the unique factorization of n into powers of distinct primes, then g(n) = p a n( + f(p) + f(p ) + + f(p a )) Proof To begin with, we observe that if (m, n) =, then any divisor d of mn can be written as d d, such that d m, d n and (d, d ) = Thus, if (m, n) =, then f(d) = f(d d ) g(mn) = d mn d=d d d m d n Since f is multiplicative, the above is equal to f(d )f(d ) = g(m)g(n) d m d n Thus, g is multiplicative It follows that, given the above factorization of n, g(n) = p a n g(p a ) = p a n( + f(p) + f(p ) + + f(p a )) () Example 3 For any s Z 0, let σ s (n) := d n d s In particular, for s = 0, σ 0 (n) is simply the number of positive divisors of n σ 0 (n) is also denoted as d(n) and τ(n) in the existing literature Since the function f(n) = n s for any s Z 0 is multiplicative, by applying Theorem, we deduce that σ s is also a multiplicative function

MÖBIUS FUNCTION AND MÖBIUS INVERSION 3 Exercise 4 For a prime p, we say that p a n if p a n but p a+ n For any n, let n = p a p a n be the unique factorization of n into powers of distinct primes Prove that σ 0 (n) = p a n(a + ) and, for any s N, σ s (n) = p a n p s(a+) p s Henceforth, we will denote σ 0 (n) as d(n) and σ (n) as σ(n) Exercise 5 Show that d(n) is odd if and only if n is a perfect square Exercise 6 Show that the product of the divisors of n is equal to n d(n)/ Definition 7 Given two arithmetic functions f and g, their Dirichlet product or Dirichlet convolution f g is the function defined by f g(n) = ( n ) f(d)g d d n Exercise 8 If f and g are multiplicative functions, so is their Dirichlet convolution f g Möbius function and Möbius inversion A number n is said to be square-free if p n for any prime p In other words, a square-free number has no square factors > The Möbius function µ is defined as follows: { ( ) ν(n) if n is square-free, µ(n) = 0 otherwise Exercise Show that µ is a multiplicative function

4 CHAPTER ARITHMETIC FUNCTIONS By Theorem, we deduce that g(n) := d n µ(d) is also a multiplicative function Exercise Prove that µ(d) = d n { if n =, 0 otherwise Remark 3 The above reinterpretation of in terms of the Möbius function is an important tool in analytic number theory As we will see in the coming pages, it has many applications Theorem 4 [Möbius inversion formula] Let f and g be arithmetic functions Then g(n) = f(d) d n if and only if f(n) = d n ( n ) µ(d)g d Proof We observe that ( n ) µ(d)g d d n = µ(d) f(e) d n e n d = µ(d) d: ad=n = des=n = e n e: es=a µ(d)f(e) f(e) d n e µ(d) f(e) By Exercise, the inner sum equals if e = n and 0 otherwise Thus, f(e) µ(d) = f(n) e n d n e The converse is proved in a similar way and is left as an exercise

3 EULER S PHI FUNCTION 5 Exercise 5 Let Λ(n) = log p if n is a power of the prime p and 0 otherwise Show that log n = Λ(d) d n Deduce that Λ(n) = d n ( n ) µ log d, d where µ denotes the Möbius function 3 Euler s Phi function A very important arithmetic function is Euler s φ- function, which is defined to be the number of positive integers less than or equal to n, which are coprime to n That is, φ(n) := k n (k,n)= Möbius inversion formula gives us an elegant proof of the fact that φ(n) is multiplicative and also establishes a formula for φ(n) Exercise 3 Show that d n φ(d) = n From this, deduce that φ(n) = n d n µ(d) d Exercise 3 Show that φ is a multiplicative function Deduce that φ(n) = n ( ) p p n Exercise 33 For any n, prove that n φ(n) If n is composite, then prove that φ(n) n n Exercise 34 Show that if φ(n) is odd, then n = or n = Exercise 35 Let f(n) be the sum of the natural numbers n which are coprime to n

6 CHAPTER ARITHMETIC FUNCTIONS Show that + + n = d n df(n/d) Deduce that for n >, f(n) = nφ(n)/ Show that f(n) is divisible by n for n > 3 Show that the numerator of the sum of the reciprocals of the natural numbers n which are coprime to n is divisible by n Exercise 36 Prove that d n µ (d) φ(d) = n φ(n) Exercise 37 Prove that ( n d(m)φ = σ(n) m) m n and m n ( n σ(m)φ = nd(n) m) Exercise 38 If n is a squarefree integer, prove that σ(d k )φ(d) = n k d n Exercise 39 Let J r (n) = n r p n ( p r ) For r =, J r (n) = φ(n) Prove that n r = d n J r (d)

4 GREATEST INTEGER FUNCTION 7 4 Greatest Integer Function Let x be a real number The greatest integer of x, denoted by [x] is the largest integer x In other words, it is the unique integer satisfying x < [x] x For example, [ ] 5 =, [ ] = We note that [x] = x if and only if x Z The difference x [x] is called the fractional part of x and is denoted by {x} Clearly, 0 {x} < Exercise 4 [x + n] = [x] + n for any n Z For any x, y R, [x] + [y] [x + y] 3 For any n N, [ x = n] [ ] [x] n 4 For any n, m, k N, [ nm ] [ m ] n k k Exercise 4 Let n be a positive integer and p be a prime Prove that for any k, exactly [n/p k ] multiples of p k occur in n! Conclude that the highest power of p that divides n! is [ ] n k= p k 3 Prove that n! = p n pp k= h n p i k Exercise 43 Find the highest power of 0 dividing 000! Exercise 44 Let n, r N and r < n Let ( n r) denote the binomial coefficient defined as ( ) n n! = r r!(n r)!

8 CHAPTER ARITHMETIC FUNCTIONS (a) Find the highest power of p dividing r!(n r)! (b) For each prime factor p of r!(n r)!, prove that [ ] n [ ] r + [ ] n r p k p k p k k k k (c) Show that ( n r) is an integer Exercise 45 Prove that for a positive integer r, the product of any r consecutive integers is divisible by r Exercise 46 Let f and g be arithmetic functions such that g(n) = d n f(d) Then, for any x, n x g(n) = n x [ x f(n) n] Exercise 47 Prove that for any k 0, n x σ k (n) = n x n k [ x n ] In particular, we get Exercise 48 Prove that n x d(n) = n x n x [ x n] [ x µ(n) = n] Deduce that n x µ(n) n for all x

5 THE BIG OH AND SMALL OH NOTATIONS 9 5 The big oh and small oh notations Definition 5 For a complex valued function f(x) and a real valued function g(x) such that g(x) > 0 for all x a, we write f(x) = O(g(x)) (and say that f(x) is big oh of g(x)) if there exists a constant C > 0 such that f(x) Cg(x) for all x a Definition 5 For functions f(x) and g(x), we write f(x) = o(g(x)) and say that f(x) is little oh of g(x) if f(x) lim x g(x) = 0 Definition 53 For functions f(x) and g(x), we write f(x) g(x) and say that f(x) is asymptotic to g(x) if f(x) lim x g(x) = Exercise 54 Show that d(n) = O( n) Exercise 55 Let ν(n) denote the number of distinct prime divisors of n Prove that ν(n) = O(log n) More precisely, ν(n) log n log Exercise 56 Let f(x) be a monotonically decreasing, continuous function defined on [a, b + ] Prove that b b b+ f(t)dt > f(j) > f(t)dt Deduce that a b f(j) = j=a Exercise 57 Show that b a n j= j=a f(t)dt + O( f(a ) + f(b) ) j a = log n + O() Exercise 58 Show that σ(n) = O(n log n), where σ(n) or σ (n), as defined in Example 3 refers to the sum of the (positive) divisors of n

0 CHAPTER ARITHMETIC FUNCTIONS 6 Averages of arithmetical functions Many arithmetic functions of interest to us fluctuate a lot and it is difficult to study their behaviour For example, d(n) does not seem to follow any smooth pattern as n increases It takes the value infinitely often and right next to a prime may lie a composite number with a large number of prime divisors and therefore a large number of divisors For arithmetic functions of this nature, we study the arithmetic mean n n f(k) k= Definition 6 Let f be an arithmetic function and let g be a monotonically increasing function on R We say that the average order of f(n) is g(n) if lim x n x f(n) xg(x) =, that is, if f(n) xg(x) n x Exercise 6 Show that the average order of d(n) is log n Solution Observe, by Exercise 47, that n x d(n) = n x d n = n x d: de=n = d x e x d = [ x d] d x

6 AVERAGES OF ARITHMETICAL FUNCTIONS Now, [x] = x {x} = x + O() Thus, from above, [ x d] From this, we deduce ( n x lim d(n) ) x x log x d(n) = n x d x = ( ) x d + O d x d x = x d + O(x) d x = x(log x + O()) + O(x) = x log x + O(x) Thus, the average order of d(n) is log n ( ( )) = lim + O = x log x Exercise 63 Let f(x) be a monotonically decreasing and continuous function on [, ) Prove that, for any x, f(n) n>x [x] f(t)dt Deduce that where n x ζ(s) = ( ) n = ζ() + O, x n= for anys > ns Exercise 64 Show that the average order of σ(n) is ζ() n

CHAPTER ARITHMETIC FUNCTIONS One would be tempted to follow a procedure similar to the one followed in Exercise 6, that is, apply Exercise 47 to get [ x d d] σ(n) = n x d x = ( x ) d d + O() d x = x d x + d x O(d) = x[x] + O(x ) = x(x + O()) + O(x ) = O(x ) But, this calculation does not give us the average order of σ(n) We probably threw away too much information in this estimation and hence, do not have a main term We re-examine n x σ(n) as follows:

6 AVERAGES OF ARITHMETICAL FUNCTIONS 3 Solution n x d:de=n e = d x = d x e e x d { + + + [ x d]} = [ x ] ([ x ) + d d] d x = ( x ) ( x ) d + O() d + O() d x = [ x ( x ) ] d + O d d x ( = x d + O x ) d d x d x ( = x ζ() ) + O(x log x) d d>x ( ( )) = x ζ() + O + O(x log x) x ζ() + O(x log x) This proves that the average order of σ(n) is = x ζ() n Exercise 65 (a) Let f and g be two arithmetic functions such that g(n) = d n f(d) and the series f(n) n= and g(n) n s n= n s s > Show that, for any s >, ζ(s) n= f(n) n s = n= are absolutely convergent for g(n) n s

4 CHAPTER ARITHMETIC FUNCTIONS (b) Using (a), prove that if s >, ζ(s) n= µ(n) n s = (c) Show that φ(n) = n x x + O(x log x) ζ() [Hint: φ(n) = d n µ(d) n d ] (d) Conclude that the average order of φ(n) is n ζ() Exercise 66 Let n and k be positive integers and k > Then, n is said to k-free if it is not divisible by the k-th power of any prime number Let s k (n) = if n is k-free and 0 otherwise Show that s k (n) = c k x + O(x /k ), n x where c k = n= µ(n) n k

Chapter 3 Congruences 3 Definition and basic properties In this book Disquisitiones Arithmeticae, Gauss introduced the notion of congruences, which provides a natural and convenient approach to address problems related to divisibility of integers The theory of congruences makes the theory of divisibility more or less analogous to the theory of equations Definition 3 Let a, b and m be integers with m > 0 We say that a is congruent to b modulo m and write a b (mod m) if m divides a b The number m is said to be the modulus of the congruence Thus, a 0 (mod m) if and only if m a If m a b, we write a b (mod m) By division algortihm, given a, n Z, such that n > 0, there exist unique integers q and r such that 0 r < n such that a = qn + r This implies that given a fixed integer n > 0, for any a Z, there exists a unique 0 r < n such that a r (mod n) We call r the residue of a mod n The set {x Z : x r (mod n)} is called the residue class or congruence class r (mod n) A set of m elements, one belonging to each residue class r (mod m) is called a complete residue system modulo m The following theorem describes important properties of congruence: Theorem 3 Let a, b, c, d, n be integers with n > 0 Then 5

6 CHAPTER 3 CONGRUENCES (i) a a (mod n) (ii) If a b (mod n), then b a (mod n) (iii) If a b (mod n) and b c (mod n), then a c (mod n) (iv) If a b (mod n) and c d (mod n), then a ± c b ± d (mod n) and ac bd (mod n) Proof The above properties can be proved easily and are left to the reader as an exercise From the above theorem, we immediately conclude the following: Corollary 33 If a b (mod n), then a k b k (mod n) for any positive integer k More generally, let f(x) be a polynomial with integer coefficients If a b (mod n), then f(a) f(b) (mod n) Exercise 34 Prove that 5 + is divisible by 64 Exercise 35 Prove that 5n 3 + 7n 5 0 (mod ) for all integers n Exercise 36 Prove that a positive integer is divisible by 9 if and only if the sum of its digits is divisible by 9 Exercise 37 What is the remainder when 5 + 5 + 00 5 is divided by 4? Exercise 38 If p is a prime such that n < p < n, show that ( ) n 0(mod p) n Theorem 39 If c > 0, then a b (mod n) if and only if ac bc (mod nc) Proof This follows trivially from the fact that n (b a) if and only if cn c(b a) Theorem 30 If ac bc (mod n) and if d = (c, n), then ( a b mod n ) d

3 DEFINITION AND BASIC PROPERTIES 7 Proof By Theorem 39, the above implies ac bc (mod n) n c(a b) n d c (a b) d Since ( n d d), c =, we get Thus, a b n (a b) d ( mod n ) d Exercise 3 If a b (mod n), then show that (a, n) = (b, n) Theorem 3 a b (mod n) if and only if a and b give the same remainder when divided by n Proof Let a = nq + r and b = nq + r such that 0 r, r < n Clearly, a b r r (mod n) So a b (mod n) if and only if r r 0 (mod n) Since, 0 r r < n, we observe that r r 0 (mod n) if and only r r = 0, that is r = r Thus, a b (mod n) if and only if they have the same remainder when divided by n Recall the Euler φ-function φ(n) = #{ a n; (a, n) = } In Exercise 3, we showed that φ(n) is a multiplicative function In the following exercise, we will prove this again using the theory of congruences Exercise 33 (a) Given integers a, m, n show that (a, mn) = if and only if (a, m) = (a, n) = Thus, { a mn : (a, mn) = } = { a mn : (a, m) = (a, n) = }

8 CHAPTER 3 CONGRUENCES (b) Let m, n > Let us arrange all integers between and mn by clubbing them into m columns and n rows as follows: r m m + m + m + r m (n )m + (n )m + (n )m + r nm where r m We denote the r-th column as C r Show that all the numbers in C r are co-prime to m if and only if r is co-prime to m This tells us that only φ(m) columns contain numbers co-prime to m and every number in such a column is co-prime to m (c) Let (m, n) = Show that no two numbers in C r are congruent (mod n) Deduce that elements in C r are congruent (mod n) to 0,,, n in some order (d) Deduce that each C r contains φ(n) elements co-prime to n (e) Finally, deduce that if (m, n) =, then φ(mn) = φ(m)φ(n) 3 Congruence powers and Euler s theorem Let n > 0 and (a, n) > Can we have a k (mod n) for some k? If this were possible, then we would have an integer y such that a k ny = But, since (a, n) >, this would imply that a k ny would have a divisor greater than, which is not possible Hence, for a k to be congruent to mod n it is necessary that (a, n) = Theorem 3 Let (a, n) = Then we have a φ(n) (mod n) Proof Let b, b,, b φ(n) be the φ(n) numbers lying between and n which are co-prime to n Since (a, n) =, we have (b i a, n) = for all i φ(n) Thus, by Exercise 3, each number in the list b a, b a,, b φ(n) a (mod n)

3 CONGRUENCE POWERS AND EULER S THEOREM 9 is congruent to some number in the list b, b,, b φ(n) Suppose b i a b j a (mod n) for some b i b j φ(n) Then, n (b j a b i a), which implies that n (b j b i ), since (a, n) = But, 0 b j b i < n So, n (b j b i ) if and only if b i = b j Thus, the residues of b a, b a,, b φ(n) a (mod n) are distinct (mod n) This means that the list of residues of is the same as the list b a, b a,, b φ(n) a (mod n) b, b,, b φ(n), though the numbers may be in a different order Hence, by Theorem 3, the product of all the numbers in the first list is congruent to the product of all the numbers in the second list (mod n) Thus, b b b φ(n) a φ(n) b b b φ(n) (mod n) Since (b b b φ(n), n) =, we deduce a φ(n) (mod n) Corollary 3 [Fermat s little theorem] If p is a prime and (a, p) =, then a p (mod p) Proof Since φ(p) = p, this follows from the above theorem Exercise 33 Find the last two digits of 3 000 Exercise 34 Check if the integer 53 03 + 03 53 is divisible by 39 and if 333 + 333 is divisible by 7

30 CHAPTER 3 CONGRUENCES 33 Linear congruence equations In a high school algebra class, we have learnt to solve certain equations of the form f(x) = 0, where f(x) is a polynomial with integer coefficients We can also consider congruence equations of the form f(x) 0 (mod m) and ask how many solutions such an equation has We first need to understand what we mean by a solution of a congruence equation If an integer x satisfies the equation f(x) 0 (mod m), so does any integer y x (mod m), by Corollary 33 Thus, every congruence equation having one integer solution has infinitely many integer solutions We therefore do not count solutions which belong to the same residue class as distinct Henceforth, the number of solutions of f(x) 0 (mod m), will refer to the number of incongruent solutions of this equation, or in other words, the number of integer solutions of this equation contained in the set {,,, m} In this section, we consider polynomials f(x) of degree, in other words, equations of the form ax b (mod m) For example, how many solutions does x 3 (mod 4) have? Observe that neither of x =,, 3, 4 satisfies this congruence Therefore, this equation does not have a solution For large values of m, it is not feasible to check for solutions to ax b (mod m) by checking all residues mod m We now state some theorems which explicitly determine how many solutions a linear congruence equation has and how to find those solutions Theorem 33 Let (a, m) = The linear congruence equation ax b (mod m) has exactly one solution Proof Consider the set {a, a, 3a,, ma} If ia ja (mod m) for some i j m, then m (i j)a Since (a, m) =, this implies that m (i j), which is possible only when i = j, since 0 j i m Thus, any two elements in the above set are incongruent to each other (mod m) That is, the above set forms a complete residue system mod m Thus, there exists a unique integer x lying between and m such that ax (mod m) Remark 33 How do we determine the solution of ax b (mod m)? Observe that this is equivalent to finding integers x and y such that ax+my = b To do so, we first find integers X and Y such that ax +my = This can be done using the method described after Exercise 36 Then, x = bx, y = by are solutions of ax+my = b We reduce x modulo m to solve ax b (mod m)

33 LINEAR CONGRUENCE EQUATIONS 3 Theorem 333 Let (a, m) = d The linear congruence equation ax b (mod m) has a solution if and only if d b Proof Suppose ax b (mod m) has a solution This implies that there exist integers x, y such that ax + my = b Since d ax and d my, we deduce that d b Conversely, suppose d = (a, m) divides b Since (a/d, m/d) =, the congruence a d x b ( mod m ) d d has a solution by Theorem 33 By Theorem 39, this solution is also a solution of ax b (mod m) Theorem 334 Let (a, m) = d and d b The linear congruence ax b (mod m) (3) has exactly d solutions modulo m Let t be the unique solution (mod m/d) of the linear congruence a d x b ( mod m ) (3) d d Then the solutions of ax b (mod m) are given by t, t + m d, t + m d,, t + (d )m d, Proof By Theorem 39, any solution of equation 74 is also a solution of equation 73 Moreover, if an integer t satisfies the congruence equation 74, so does any integer of the form t + j m, j Z Therefore, d t, t + m d, t + m d,, t + (d )m d, are solutions of equation 74 and therefore of equation 73 Suppose This implies t + j m d t + k m d (mod m) for some 0 j k d j m d k m (mod m) d

3 CHAPTER 3 CONGRUENCES and therefore j k (mod d) But 0 k j d So, j = k In other words, the solutions t, t + m d, t + m d,, t + (d )m d are incongruent mod m Finally, we show that any solution of equation 73 is contained in the above list Let t 0 be a solution of equation 73 Then at 0 at (mod m) m a(t t 0 ) m d d a(t t 0) m d a d (t t 0) m d (t t 0) ( t t 0 mod m ) d Thus t 0 = t + l m d for some l Z But, l r (mod d) for some 0 r d Therefore, l m d r m d (mod m) Thus, t 0 = t + l m d r m d (mod m) for some 0 r d, that is any solution of equation 73 is contained in the list t, t + m d, t + m d,, t + (d )m d Exercise 335 Solve the linear congruences: (a) 5x 5(mod 9) (b) 40x 33(mod 30) (c) 3x 0(mod 99)

34 SIMULTANEOUS LINEAR CONGRUENCES AND THE CHINESE REMAINDER THEOREM33 34 Simultaneous linear congruences and the Chinese Remainder Theorem A Chinese mathematical work from the early fourth century posed the following problem: We have a number of things, but we do not know exactly how many If we count them by threes, we have two left over If we count them by fives, we have three left over If we count them by sevens, we have two left over How many things are there? Sun Tzu Suan Ching (Master Sun s Mathematical Manual) Circa AD 300, Volume 3, Problem 6 In the language of congruences, Master Sun is asking us to find a positive integer x satisfying the following system of equations: x (mod 3), x 3 (mod 5), x (mod 7) The first equation tells us that x = 3t+ for some integer t Substituting this in second and third equations, we have 3t (mod 5) and 3t 0 (mod 7) Since (3, 7) =, we get t 0 (mod 7), that is, t = 7y for some y Z Since 3t (mod 5), we have y (mod 5), which implies, y (mod 5) We deduce that y = 5k +, t = 7y = 35k + 7 and finally, x = 3t + = 05k + 3 So any positive integer x of the form 05k + 3 satisfies all the congruence equations above That is, the above system of congruences has exactly one solution between and 05 That is, this system has a unique solution x 3 (mod 05) On the other hand, there is no x simultaneously satisfying x (mod ) and x 0 (mod 4) Notice that while 3,5 and 7 are mutually co-prime, and 4 are not co-prime The following theorem describes the conditions under which systems of linear congruences can be solved Theorem 34 [Chinese Remainder Theorem] Let n, n, n k be mutually coprime positive integers, that is, (n i, n j ) = for all i j Then, the system of congruences x c (mod n )

34 CHAPTER 3 CONGRUENCES x c (mod n ) x c k (mod n k ) has a unique solution (modn n n k ) Proof Let N = n n n k and N i = N/n i for each i k Then (n i, N i ) = Thus for each N i, there exists a unique N i modulo n i such that N i N i (mod n i ) Consider x = k c i N i N i i= For each i, c i N i N i c i (mod n i ) and N j 0 (mod n i ) whenever i j Thus, for each i k, k c i N i N i c i (mod n i ) i= Thus, x satisfies every congruence in the system We now show that x is unique (mod N) Suppose x and y are two integers satisfying all the equations above Then x y (mod n i ) for each i k Since n i s are mutually coprime, we get x y (mod N) Exercise 34 Show that x = c N φ(n ) + c N φ(n ) + + c k N k N φ(n k) k is a simultaneous solution to the above system of congruences In the next few exercises, we practice using Chinese Remainder Theorem and also look at systems where n i s are not mutually co-prime Exercise 343 Find a simultaneous solution mod 900 for the system x 3 (mod 4) x (mod 9) x (mod 5)

34 SIMULTANEOUS LINEAR CONGRUENCES AND THE CHINESE REMAINDER THEOREM35 Exercise 344 Find the last two digits in the expansion of 4 000 Exercise 345 Prove that for every a coprime to 56 a 560 (mod 56) Exercise 346 Let us consider two sets A and B where and A = {a : a mn such that gcd (a, mn) = } B = {(b, c) : b m, c n, gcd (b, m) =, gcd (c, n) = } Remember that the set B contains pairs (or -tuples) of certain numbers Now, define a function f : A B as follows: f(a mod mn) = (a mod m, a mod n) Thus, f takes an integer a in the first set and sends it to a pair (b, c) with a b mod m and a c mod n (a) Show that f is injective (one-to-one) (b) Show that f is surjective (onto) [Hint: Use CRT] (c) From the above, conclude that φ(mn) = φ(m)φ(n) Exercise 347 Find an integer x that satisfies x 6 (mod 5), x 9 (mod 4) Is this integer unique? Is this integer unique (mod 0)? Exercise 348 Show that the system of congruences x 5 (mod 6) x 7 (mod 0) has more than one solution modulo 60

36 CHAPTER 3 CONGRUENCES 35 Polynomial congruences In this section, we will study congruence equations of the form f(x) 0 (mod n), where f(x) is a polynomial with integer coefficients To motivate this discussion, let us start with simple polynomials of degree, which play an important role in number theory Let p be a prime Consider f(x) = x How many solutions modulo p does the equation x (mod p) have? Observe that x (mod p) p (x ) p (x )(x + ) Either p (x ) of p (x + ) x ± (mod p) (mod p) if and only if p = Thus, x (mod p) has a unique solution if p = and has exactly two solutions if p is an odd prime This fact has an interesting consequence: Theorem 35 [Wilson s Theorem] If p is a prime, then (p )! (mod p) Proof Consider the numbers,,, p Among these numbers, and p satisfy x (mod p) By Theorem 33, for each a p, there exists a unique a p such that aa (mod p) Moreover a a, since a (mod p) if and only if a =, p Thus, 3 (p ) (mod p) Moreover p (mod p) Thus, 3 (p ) (mod p) Corollary 35 (n )! (mod n) if and only if n is a prime Proof Sufficiency is proved by Wilson s theorem If n is not a prime, then there exist a, b n such that ab = n If a b, then clearly n (n )!, since both a and b are factors of (n )! If a = b, that is, if n = a, then for n > 4, both a and a lie between and n Thus,n = a divides (n )! Therefore, (n )! 0 (mod n) For n = 4, one immediately checks that 3! (mod 4) Thus, (n )! (mod n) if and only if n is a prime As a consequence of Wilson s theorem, we also make the following observation:

35 POLYNOMIAL CONGRUENCES 37 Corollary 353 For a prime p, ( ) p [( p )!] (mod p) Proof For any integer i lying between and (p )/, we observe that Thus, = p p i i (mod p) (p )! = (p ) ( p p ( ) p [( p Thus, by Wilson s theorem, for a prime p, ( ) p [( p ) (p )(p ) )!] (mod p) )!] (mod p) We now prove a theorem regarding the solutions of x (mod p) Theorem 354 For an odd prime p, x (mod p) has a solution if and only if p (mod 4) Proof Suppose x (mod p) has a solution x = a Thus, a p (a ) p ( ) p (mod p) (33) Clearly, (a, p) =, otherwise a 0 (mod p) Thus, by Theorem 3, we have a p (mod p) (34) Combining equations (33) and (34), we get ( ) p (mod p)

38 CHAPTER 3 CONGRUENCES Therefore, (p )/ is even That is, p (mod 4) Conversely, suppose p (mod 4) Then (p )/ is even Thus, by Corollary 353, [( p )!] (mod p), and therefore, has a solution x (mod p) Exercise 355 Find all integer solutions of y = 3x 3 + if any [Hint: Consider the above equation modulo 3] Let us now try and solve some other quadratic congruences (that is, quadratic equations formed by polynomials of degree ): Exercise 356 Find the solutions, if any, of the following quadratic congruences: (a) x + 4x + 0 (mod 3) (b) 3x + 9x + 7 (mod ) Recall, from high school algebra, that to solve the quadratic equation, we simplified it into Thus, a ax + bx + c = 0, a 0, ( ( x + b ) a ( ) ) b 4ac = 0 x = b ± b 4ac a To what extent does this calculation hold mod p? For an odd prime p, if (a, p) =, then we can solve 4a ax (mod p)

35 POLYNOMIAL CONGRUENCES 39 If we can solve the equation then x( b ± y) will be solutions of y b 4ac (mod p), ax + bx + c 0 (mod p) Thus, solving a quadratic congruence reduces to the problem of solving a linear congruence and a congruence of the form for a given integer A y A (mod p), Exercise 357 Show that for any prime p, the equation x 3 (mod p) will have either one solution or three solutions Explain under what conditions it will have three solutions We therefore ask the following questions: Under what conditions does y A (mod p) have a solution? How many solutions can it possibly have? We postpone the discussion of the first question to the next section The second question is answered by the following theorem of Lagrange: Theorem 358 [Lagrange s theorem] Given a prime p, let f(x) = a 0 + a x + + a n x n, a i Z be a polynomial of degree n such that c n 0 (mod p) Then the polynomial congruence f(x) 0 (mod p) has at most n solutions

40 CHAPTER 3 CONGRUENCES Proof We prove this theorem by induction Since a 0 (mod p), by Theorem 33, the equation a x + a 0 0 (mod p) has a unique solution Thus, the theorem is true for n = Suppose that the theorem is true for polynomials of degree n Assume, also, that the equation a 0 + a x + + a n x n 0 (mod p), a n 0 (mod p) has n + incongruent solutions mod p, say x 0, x,, x n We have f(x) f(x 0 ) = n a k (x k x k 0) = (x x 0 )g(x), k= where degree of g(x) is n and the leading coefficient of g(x) is c n which is 0 (mod p) We observe that for every k n, Thus, f(x k ) f(x 0 ) (mod p) f(x k ) f(x 0 ) = (x k x 0 )g(x k ) 0 (mod p) Since x k and x 0 are incongruent (mod p), we get g(x k ) 0 (mod p) for every k n Thus, g(x) 0 (mod p) has n incongruent solutions (mod p), which contradicts our induction hypothesis that it can have at most n solutions Therefore, a 0 + a x + + a n x n 0 (mod p), a n 0 (mod p) has at most n solutions n By induction, we have proved the result for all Remark 359 The above theorem may not hold for a composite modulus n For example, x 0 (mod 8) has 4 solutions

35 POLYNOMIAL CONGRUENCES 4 From Lagrange s theorem, we deduce the following corollary: Corollary 350 If p is a prime number and d p, then the congruence equation x d 0 (mod p) has exactly d solutions Proof Let p = dk for some integer k Then x p = (x d )(x d(k ) + x d(k ) + x + ) That is, x p = (x d )f(x), where f(x) is a polynomial with integer coefficients of degree p d By Theorem 3, we know that x p 0 (mod p) has exactly p solutions (namely x =,,, p ) By Lagrange s theorem, we know that x d 0 (mod p) has at most d roots and f(x) 0 (mod p) has at most p d roots Therefore, x d 0 (mod p) must have exactly d roots, since if it has fewer than d roots, the number of roots of the equations x p 0 (mod p) and will not match up (x d )f(x) 0 (mod p) Exercise 35 If p is an odd prime, prove that the congruence equation x p + + x + x + 0 (mod p) has exactly p solutions and they are, 3,, p Exercise 35 Let n = p p p k, where p i s are distinct primes (a) Show that if all the p i s are odd, then the number of solutions to x (mod n) is k (b) Show that if p i = for some i, then the above congruence has k solutions

4 CHAPTER 3 CONGRUENCES 36 Order and primitive roots Let a and m be co-prime integers such that m > 0 By Euler s theorem (Theorem 3), we know that a φ(m) (mod m) However, there might be a smaller power k φ(m) for which a k (mod m) Definition 36 The smallest positive integer k for which a k (mod m) is called the order of a modulo m and is denoted by ord m (a) If ord m (a) = φ(m), then a is called a primitive root of m or a primitive root mod m Exercise 36 Find ord 7 () and ord 7 (3) Theorem 363 Let a and m be co-prime integers such that m > 0 Let k = ord m (a) Then (a) a l (mod m) if and only if l 0 (mod k) (b) a i a j (mod m) if and only if i j (mod k) (c) The numbers, a, a,, a k are incongruent mod m Proof (a) If l 0 (mod k), then clearly a l (mod m) Conversely, suppose a l (mod m) By division algorithm, we know that there exist unique integers q and r such that l = qk + r, such that 0 r < k Observe that a r a r a kq a r a qk+r a l (mod m) Since k = ord m (a) and r < k, we get r = 0, Thus, l = qk and therefore l 0 (mod k) (b) This follows easily from (a)

36 ORDER AND PRIMITIVE ROOTS 43 (c) Suppose By part (b), this means that a i a j (mod m) for some i j m i j (mod k) Since 0 j i k, this is not possible unless j i = 0, that is, j = i Thus, the numbers, a, a,, a k are incongruent mod m For any modulus m, let a, a,, a φ(m) denote all the integers between and m which are co-prime to m Any collection of φ(m) integers, which are incongruent mod m and each of which is congruent to one of the a i s is called a reduced residue system (mod m) Theorem 363(c) tells us that if a is a primitive root of m, then {a, a,, a φ(m) } forms a reduced residue system (mod m) Exercise 364 Let (a, m) = Prove that a is a primitive root of m if and only if {a, a,, a φ(m) } forms a reduced residue system (mod m) Exercise 365 Knowing that is a primitive root of 9, find all a (mod 9) for which x a (mod 9) has a solution Theorem 366 For a prime p and a divisor d of p, let ψ(d) = { a p : ord p (a) = d} Then d = d i d ψ(d i ) Therefore, φ(d) = ψ(d) Proof If x d (mod p), then ord p (x) divides d So, if we look at all the divisors of d and for each divisor d i of d, consider A(d i ) = { x p : ord p (x) = d i },

44 CHAPTER 3 CONGRUENCES then A(d i ) = { x p : x d (mod p)} d i d From Theorem 350, we know that if d p, then the congruence equation x d 0 (mod p) has exactly d solutions Thus, we deduce that d = A(d i ) = ψ(d i ), d i d d i d where A(d i ) denotes the numbers of elements in A(d i ) By Möbius inversion and Exercise 3, we get ψ(d) = d i d d d i µ(d i ) = φ(d) From this, we conclude one of the most important results in number theory: Theorem 367 [Primitive Root Theorem] Every prime p has a primitive root Proof Applying Theorem 366 for d = p and noting that φ(p ) for all primes p, we see that every prime p has a primitive root In fact, it has exactly φ(p ) primitive roots Exercise 368 If a = b is a perfect square and p is an odd prime, can a be a primitive root of p? Exercise 369 Find all primitive roots of 7 The primitive root theorem helps us to answer a question raised in the previous section, namely when does the equation x a (mod p) have a solution

36 ORDER AND PRIMITIVE ROOTS 45 Theorem 360 [Euler s criterion] Let p be an odd prime and (a, p) = Then, x a (mod p) has a solution if and only if a p (mod p) Proof Suppose x a (mod p) has a solution, say x = x Since (a, p) =, we have (x, p) = Thus, a p (x ) p x p (mod p), by Fermat s little theorem Conversely, suppose a p (mod p) By primitive root theorem, p has a primitive root, say, r So, This implies a r k (mod p) for some k p (r k ) p a p (mod p) But ord p (r) = p Therefore, by Theorem 363(a), we have (p ) k(p ) Thus, k is an even integer, say k = l Thus, a r k r l (r l ) (mod p) That is, x = r l is a solution of x a (mod p) In particular, Theorem 354 is a special case of Euler s criterion Exercise 36 Prove that there exist infinitely many primes of the form 4n + [Hint: Suppose there were only finitely many primes of this kind and let N denote their product What can you say about any prime factor of 4N +?]

46 CHAPTER 3 CONGRUENCES Exercise 36 Check if the congruence x (mod 95) has a solution Exercise 363 Does the congruence x (mod 6) have any solutions? Why or why not? Is a primitive root of 6? Why or why not? Exercise 364 Does the congruence x (mod 6) have any solutions? Why or why not?

Chapter 4 Quadratic residues and the quadratic reciprocity law 4 Quadratic residues Definition 4 Let p be a prime A nonzero integer that is congruent to a square modulo p is called a quadratic residue (QR) (mod p) In other words, any nonzero integer a, which is co-prime to p is said to be a quadratic residue (mod p) if the equation x a (mod p) has a solution A nonzero integer that is not congruent to a square modulo p is called a quadratic nonresidue (QNR) (mod p) For example, and 4 are QRs (mod 5) and, and 4 are QRs (mod 7) and 3 are QNRs (mod 5) and 3, 5 and 6 are QNRs (mod 7) Theorem 4 Let p be an odd prime Then every reduced residue system (mod p) has exactly (p )/ quadratic residues and exactly (p )/ quadratic nonresidues (mod p) The quadratic residues are the residues containing the numbers ( ) p,,, Proof We know that the elements of a reduced residue system (mod p) are,, 3,, p 47

48CHAPTER 4 QUADRATIC RESIDUES AND THE QUADRATIC RECIPROCITY LAW So, the quadratic residues (mod p) are,,, (p ) However, and Thus, are congruent to p + x p p x p x (p x) (mod p) ( ) p +,, (p ) (mod p) ( ) p,,, (mod p) Thus, quadratic residues (mod p) lie in the list ( ) p,,, No two elements in this list are congruent to each other (mod p) If then Since x y (mod p) for some x y p, p (x + y)(x y) x + y p, we get x y (mod p) But, y x p Thus, x y (mod p) x = y This proves that there are exactly (p )/ quadratic residues and therefore exactly (p ) (p )/ = (p )/ quadratic nonresidues (mod p) In the last chapter, we learnt in Theorem 360 that a is a quadratic residue (mod p) if and only if and only if a p (mod p)