PartII Number Theory

Similar documents
Part II. Number Theory. Year

I(n) = ( ) f g(n) = d n

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

MATH342 Practice Exam

Number Theory Naoki Sato

Chapter 3. Number Theory. Part of G12ALN. Contents

The Hasse Minkowski Theorem Lee Dicker University of Minnesota, REU Summer 2001

Math 104B: Number Theory II (Winter 2012)

Primes - Problem Sheet 5 - Solutions

Number Theory. Lectured by V. Neale Michaelmas Term 2011

Math 314 Course Notes: Brief description

PRIME NUMBERS YANKI LEKILI

6 Binary Quadratic forms

Jacobi symbols and application to primality

ANALYTIC NUMBER THEORY AND DIRICHLET S THEOREM

MATH 3240Q Introduction to Number Theory Homework 7

3 Properties of Dedekind domains

t s (p). An Introduction

Algebraic Number Theory

Introductory Number Theory

The Euler Phi Function

Algebraic number theory LTCC Solutions to Problem Sheet 2

DISCRIMINANTS IN TOWERS

Elementary Number Theory

Summary Slides for MATH 342 June 25, 2018

MATH 361: NUMBER THEORY EIGHTH LECTURE

QUADRATIC RECIPROCITY

MATH 371 Class notes/outline October 15, 2013

QUADRATIC RECIPROCITY

1 Integers and the Euclidean algorithm

We collect some results that might be covered in a first course in algebraic number theory.

LECTURE 4: CHINESE REMAINDER THEOREM AND MULTIPLICATIVE FUNCTIONS

MATH 371 Class notes/outline September 24, 2013

By Evan Chen OTIS, Internal Use

QUADRATIC RECIPROCITY

(Workshop on Harmonic Analysis on symmetric spaces I.S.I. Bangalore : 9th July 2004) B.Sury

RECIPROCITY LAWS JEREMY BOOHER

x 2 a mod m. has a solution. Theorem 13.2 (Euler s Criterion). Let p be an odd prime. The congruence x 2 1 mod p,

MAT 311 Solutions to Final Exam Practice

On the Multiplicative Order of a n Modulo n

Introduction to Arithmetic Geometry Fall 2013 Lecture #10 10/8/2013

MATH 361: NUMBER THEORY THIRD LECTURE

Practice Final Solutions

MA3H1 Topics in Number Theory. Samir Siksek

Practice Final Solutions

GAUSSIAN INTEGERS HUNG HO

Almost 4000 years ago, Babylonians had discovered the following approximation to. x 2 dy 2 =1, (5.0.2)

DIRICHLET S THEOREM ON PRIMES IN ARITHMETIC PROGRESSIONS. 1. Introduction

HOMEWORK # 4 MARIA SIMBIRSKY SANDY ROGERS MATTHEW WELSH

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

Maths 4 Number Theory Notes 2012 Chris Smyth, University of Edinburgh ed.ac.uk

HENSEL S LEMMA KEITH CONRAD

Elementary Analysis in Q p

Elementary Number Theory Review. Franz Luef

2 Asymptotic density and Dirichlet density

A CONCRETE EXAMPLE OF PRIME BEHAVIOR IN QUADRATIC FIELDS. 1. Abstract

MATH 152 NOTES MOOR XU NOTES FROM A COURSE BY KANNAN SOUNDARARAJAN

MA3H1 TOPICS IN NUMBER THEORY PART III

2 Asymptotic density and Dirichlet density

CERIAS Tech Report The period of the Bell numbers modulo a prime by Peter Montgomery, Sangil Nahm, Samuel Wagstaff Jr Center for Education

Math 261 Exam 2. November 7, The use of notes and books is NOT allowed.

MAS 4203 Number Theory. M. Yotov

PMATH 440/640 ANALYTIC NUMBER THEORY

Chapter 2 Arithmetic Functions and Dirichlet Series.

Mersenne and Fermat Numbers

p-adic Measures and Bernoulli Numbers

SQUAREFREE VALUES OF QUADRATIC POLYNOMIALS COURSE NOTES, 2015

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES 2018

CONGRUENCES CONCERNING LUCAS SEQUENCES ZHI-HONG SUN

Public-key Cryptography: Theory and Practice

Representing Integers as the Sum of Two Squares in the Ring Z n

MATH 361: NUMBER THEORY ELEVENTH LECTURE

DIRICHLET S THEOREM ABOUT PRIMES IN ARITHMETIC PROGRESSIONS. Contents. 1. Dirichlet s theorem on arithmetic progressions

Almost All Palindromes Are Composite

δ(xy) = φ(x)δ(y) + y p δ(x). (1)

Factorability in the ring Z[ 5]

Mobius Functions, Legendre Symbols, and Discriminants

Frobenius Elements, the Chebotarev Density Theorem, and Reciprocity

Course 2316 Sample Paper 1

Elliptic Curves Spring 2015 Problem Set #1 Due: 02/13/2015

MATH 210A, FALL 2017 HW 5 SOLUTIONS WRITTEN BY DAN DORE

An Estimate For Heilbronn s Exponential Sum

Introduction to Group Theory Note 1

2 More on Congruences

Elementary Number Theory

MAZUR S CONSTRUCTION OF THE KUBOTA LEPOLDT p-adic L-FUNCTION. n s = p. (1 p s ) 1.

A CRITERION FOR POLYNOMIALS TO BE CONGRUENT TO THE PRODUCT OF LINEAR POLYNOMIALS (mod p) ZHI-HONG SUN

Introduction to Number Theory

THUE-VINOGRADOV AND INTEGERS OF THE FORM x 2 + Dy 2. Contents. Introduction Study of an Elementary Proof

QUADRATIC FORMS, BASED ON (A COURSE IN ARITHMETIC BY SERRE)

f(r) = a d n) d + + a0 = 0

MATH 2710: NOTES FOR ANALYSIS

Smol Results on the Möbius Function

ERRATA AND SUPPLEMENTARY MATERIAL FOR A FRIENDLY INTRODUCTION TO NUMBER THEORY FOURTH EDITION

A Concise Course in Number Theory Alan Baker, Cambridge University Press, 1983

Dirichlet s Theorem on Arithmetic Progressions

MATH 242: Algebraic number theory

#A64 INTEGERS 18 (2018) APPLYING MODULAR ARITHMETIC TO DIOPHANTINE EQUATIONS

ON THE DISTRIBUTION OF THE PARTIAL SUM OF EULER S TOTIENT FUNCTION IN RESIDUE CLASSES

Math 120 HW 9 Solutions

Transcription:

PartII Number Theory zc3 This is based on the lecture notes given by Dr.T.A.Fisher, with some other toics in number theory (ossibly not covered in the lecture). Some of the theorems here are non-examinable. I ut those here just in case someone is interested. Solutions to the exercises are ut in a searate file. Contents Division 3. Division Algorithm..................................... 3. Greatest common divisor.................................. 3.3 Euclidean Algorithm.................................... 4.4 Fundamental theorem of arithmetic............................ 4.5 Exercises........................................... 5 Arithmetical functions 7. Binomial coefficients.................................... 7. The function τ(n) and Multilicative functions...................... 7.3 Euler s (totient) function φ(n)............................... 8.4 The function σ(n)...................................... 0.5 The Mobius function µ(n)................................. 0.6 Estimate............................................7 Dirichlet series....................................... 3.8 Exercises........................................... 4 3 Congruences 6 3. Definition.......................................... 6 3. Chinese remainder theorem................................ 7 3.3 Wilson s theorem...................................... 7 3.4 Lagrange s theorem..................................... 8 3.5 Primitive roots....................................... 9 3.6 Chevalley s theorem..................................... 0 3.7 Exercises........................................... 4 Quadratic Residues 3 4. Legendre s symbol..................................... 3 4. Euler s criterion....................................... 3 4.3 Gauss s lemma....................................... 5 4.4 Law of quadratic recirocity................................ 5 4.5 Jacobi s symbol....................................... 7 4.6 Hensel s lemma....................................... 8 4.7 Exercises........................................... 8

5 Binary quadratic forms 30 5. Sum of two squares..................................... 30 5. Definition and equivalence................................. 30 5.3 Reduction.......................................... 3 5.4 Reresentations by binary quadratic forms........................ 33 5.5 Exercises........................................... 34 6 Distribution of rimes 35 6. The sum and the roduct ( )..................... 35 6. Legendre s formula..................................... 36 6.3 Bertrand s ostulate.................................... 36 6.4 Partial summation formula................................. 38 6.5 Merten s results....................................... 38 6.6 Riemann zeta function................................... 40 6.7 Gamma function and the functional equation....................... 4 6.8 Riemann Hyothesis.................................... 43 6.9 Bernoulli numbers...................................... 44 6.0 Exercises........................................... 46 7 Continued fraction 48 7. Dirichlet s theorem..................................... 48 7. Convergents......................................... 48 7.3 Period............................................ 5 7.4 Pell s equation........................................ 53 7.5 A set of real numbers modulo.............................. 55 7.6 Exercises........................................... 58 8 Primality testing and factoring 60 8. Fermat seudorime.................................... 60 8. Euler seudorime..................................... 60 8.3 Strong seudorime..................................... 6 8.4 Fermat factorisation.................................... 65 8.5 Factor bases........................................ 66 8.6 The Continued fraction method.............................. 67 8.7 Pollard s method................................... 67 8.8 Exercises........................................... 68

Division. Division Algorithm Definition.. Let a, b Z. We say b divides a (written b a) if there exists an integer c such that a = bc. b is called a factor (or divisor) of a. Lemma.. For all a, b Z, b > 0, there exists q, r Z such that a = bq + r and 0 r < b. Proof. Let S = {a nb : n Z}. If 0 S then there exists q such that a bq = 0. If 0 S, then clearly S contains some ositive integer. Let r be the smallest ositive integer in S. For any x S, x b S. Therefore, if r b then r b is another ositive integer in S and r b < r which is a contradiction.. Greatest common divisor Definition.3. Let a,..., a n Z. The greatest common divisor d of a,..., a n (written (a,..., a n ) ) is a ositive integer d such that d a i for all i, and every common divisor of a,..., a n also divides d. a,..., a n are called corime if (a,..., a n ) =. Lemma.4. Given a,..., a n Z, not all zero, let I = { i b ia i : b i Z}. Then I = dz for some I. Proof. Let d be the smallest ositive integer in I. Then clearly dz I. Let a I, then by lemma. there exist q and r such that a = qd + r where 0 r < d. Since d is the smallest integer in I, so r = 0. Therefore d a and so I dz. Corollary.5. Let a,..., a n Z, not all zero. Then the greatest common divisor of a,..., a n is d where dz = { b i a i : b i Z}. i Proof. Let I = { i b ia i : b i Z} = dz for some d by revious lemma. Since a i I for all i so d a i for all i. Let d be a common factor of a,..., a n, then a i d Z for all i and so dz = I d Z. Therefore d d. Corollary.6. Let a,..., a n Z, not all zero. Then there exist b,..., b n Z such that i a ib i = c if and only if d c where d is the greatest common divisor of a,..., a n. Proof. By revious corollary, d is the ositive integer such that dz = { i a i b i : b i Z}. So there exist integer b,..., b n such that i a ib i = d, and so i a i (b i c d ) = c if d c. Conversely, if there exist b,..., b n Z such that i a ib i = c. Then c { i a ib i : b i Z} = dz and so d c. Corollary.7. If (a, b) = then there exists x, y Z such that ax + by =. 3

.3 Euclidean Algorithm We now give an algorithm to comute the greatest common divisor of two ositive integers a, b. Since (a, b, c) = ((a, b), c) so this can be used to comute the greatest common divisor of a,..., a n. If a = b then (a, b) = a. So we may assume a > b > 0. Let a = r 0 and b = r. For each i, by Lemma., take q i, r i+ to be ositive integers such that until r k+ = 0 for some k. So we have r i = r i q i + r i+, 0 r i+ < r i r 0 = r q + r, 0 < r < r ; r = r q + r 3, 0 < r 3 < r ;... r k = r k q k + r k, 0 < r k < r k ; r k = r k q k ; We claim that r k = (a, b). Indeed, (a, b) = (r 0, r ) = (r, r ) = = (r k, r k ) = r k. Moreover, by Corollary.6 there exist x, y such that ax + by = d where d = (a, b). Euclidean algorithm gives a way to comute the integers x, y. We simly work backwards: d = r k = r k r k q k = r k q k (r k 3 r k q k ) =. Examle.8. Comute x and y such that 0x + y = 4. We have and so 4 = 8 = (0 ) = 0. 0 = + 8, = 8 + 4, 8 = 4.4 Fundamental theorem of arithmetic Definition.9. A ositive integer n > is called a rime if whenever b n, b = or b = n. Otherwise n is called comosite. Lemma.0. Let be a rime. If ab then a or b. Proof. If ab and a, then (, a) =. By Corollary.7, there exists x, y such that x + ay =. Therefore, xb + aby = b. Since ab and xb so b. Similarly, Lemma.. Let n be a ositive integer. If n ab then (n, a) > or n b. Proof. If (n, a) =, then there exist x, y such that nx + ay =. Therefore, nxb + aby = b. Since n nxb, n ab so n b. Theorem. (Fundamental Theorem of Arithmetic). Every integer n > can be written as a roduct of rimes. The reresentation is unique u to order. 4

Proof. Existence is clear: If n is a rime, then we are done. Otherwise there exists a factor m of n such that < m < n. Let m be the smallest such factor between and n. Then m must be a rime. Now reeat this with n. For uniqueness, suose m n = r = q q k. Since n so q q k. Aly the revious lemma reeatedly we conclude q i for some i. We may relabel q,..., q k so that q. Then we have n = r = q q k. Reeat the above so we conclude r = k and i = q i after relabeling q,..., q k. Definition.3. Let a,..., a n be ositive integers. m is a common multile of a,..., a n if a i c for all i. m is called the least common multile of a,..., a n (written {a,..., a n }) m is a common multile of a,..., a n and m m for any other common multile m of a,..., a n. Remark.4. If a = r i= a i i Then (a, b) = r i= c i i a i + b i = c i + d i so and b = r i= b i and {a, b} = r i= d i i i where,..., r are distinct rimes and a i, b i 0. where c i = min{a i, b i } and d i = max{a i, b i }. Note that (a, b){a, b} = ab. Therefore we can comute {a, b} by comuting (a, b). One of the imortant toics in number theory is to study the distribution of rime numbers. Definition.5. The function π(x) is defined to be π(x) = { : x, is a rime}. Theorem.6 (Euclid). There are infinitely many rimes. In other words, π(x) as x. Proof. Suose there are only finitely many rimes,..., n. Let N = n i= i + and let q be a rime factor of N. Then (q, i ) = for all i because i N. So q i for all i and this gives a contradiction. Definition.7. A rime is called a Mersenne rime if = n for some n. All the largest knowing rimes are Mersenne rimes..5 Exercises. (i) Find integers x, y such that 6x + 0y =. (ii) Find integers 6x + 0y + 5z =.. For each n >, let S n = n i=. Show that S i n is not an integer. 3. Let n be a ositive integer, rove that n can be written as a sum of (at least two) consecutive ositive integers if and only if n k for some k. 4. Prove that if g, g,..., g k are integers >, then every natural number can be exressed uniquely in the form a 0 + a g + a g g + + a k g g g k where the a j are integers satisfying 0 a j < g j+. In articular, if g i = k for all k then we recover the decimal exansion in base k. 5

5. Given a b, let λ(a, b) be the number of stes of finding (a, b) by Euclidean algorithm. Show that [ ] log b λ(a, b). log 6. (i) By considering the factorisation of the form n = a b where b is square free, show that π(x) log x for x. (ii) By using Fundamental theorem of arithmetic, show that in fact π(x) log log x log log x for x large enough. 7. Show that there exist infinitely many rimes of the form 4n + 3. 6

Arithmetical functions. Binomial coefficients Definition.. Let x be a real number. [x] = max{n Z : n x}. The fractional art of x, written {x} is defined to be x [x]. For each n, we use the notation n! = n i= i. Lemma.. Let be a rime and n be a ositive integer. The largest l such that l divides n! can be exressed as l = [n/ k ]. k= Proof. For each k 0, let a k be the size of the set {m Z : m n, k m, k+ m}. Each number in the above set has exact ower k dividing n!, so l = k=0 ka k. But a k = [n/ k ] [n/ k+ ]. So l = k([n/ k ] [n/ k+ ]) = (k + )[n/ k+ ] k[n/ k+ ] = [n/ k ]. k=0 k=0 k=0 k=0 Definition.3. Given two ositive integers m n > 0, the binomial coefficient ( m n) is defined to be ( ) m m! = n n!(m n)!. Proosition.4. For all m n > 0, ( m n) is an integer. Proof. Let be a rime number. If n!(m n)! then m! because < m. By the revious lemma, if l i, i =,, 3 are the largest integers such that l n!, l (m n)!, l 3 m!, then l = [n/ k ], l = [(m n)/ k ], l 3 = [m/ k ]. k= k= k= For each k 0, we have [m/ k ] [n/ k ] + [(m n)/ k ] and so l 3 l +l. This shows that if k n!(m n)! then k m! for any rime and so by Fundamental Theorem of Arithmetic, ( m n) is an integer.. The function τ(n) and Multilicative functions Definition.5. A real function f defined on the ositive integer is said to be multilicative if f(mn) = f(m)f(n) for all m, n with (m, n) =. It is said to be comletely multilicative if f(mn) = f(m)f(n) for all ositive integers m, n. In articular, if n = i a i i then f(n) = i f( a i i ). 7

Definition.6. The function τ(n) is the number of all ositive factors of n. That is, τ(n) = d n. Lemma.7. For all (m, n) =, there is a bijection In articular, σ is multilicative. {(d, d ) N : d m, d n} {d N : d mn}, (d, d ) d d. Proof. Indeed, d d mn so the ma is well-defined. It is injective: Suose d d = d 3 d 4 where d, d 3 m, d, d 4 n. Then d d 3 d 4. But (d, d 4 ) = so d d 3 by Lemma.. Similarly, d 3 d and so d = d 3 and d = d 4. It is surjective: By Fundamental Theorem of Arithmetic we have m = i a i i and n = j qb j j where i q j for all i, j. Then mn = i,j a i i qb j j. For any d mn we have d = i,j a i i qb j j where a i a i, b j b j. Let d = i a i i and d = j qb j j, then d m and d n. So the ma is a bijection. By comaring the sizes of the two sets we conclude that σ(mn) = σ(m)σ(n). Corollary.8. Let n = i a i i. Then τ(n) = i (a i + ). Proof. It suffices to show that τ( a ) = a + for all rime a. Indeed, the factors of a are i, i = 0,,..., a. Lemma.9. If f is multilicative and if g(n) = d n f(d). Then the function g is also multilicative. Proof. By the revious lemma, we have a bijection for any (m, n) =. Therefore, {(d, d ) N : d m, d n} {d N : d mn}, (d, d ) d d g(mn) = d mn f(d) = d m,d n f(d d ) = d m f(d ) d n f(d ) = g(m)g(n)..3 Euler s (totient) function φ(n) Definition.0. The Euler s (totient) function φ(n) is defined to be the size of the set {m N : m n : (m, n) = }. By convention, φ() =. Lemma.. There is a bijection {d N : d mn, (d, mn) = } {(d, d ) N : d m, (d, m) =, d n, (d, n) = } by d (d, d ) where 0 d < m, 0 d < n such that d = q m + d, d = q n + d for some integers q, q. In articular, φ is multilicative. 8

Proof. (d, mn) = and since d = q m + d, d = q n + d, we conclude that (d, m) = and (d, n) =. So the ma is well-defined. It is injective: Suose d = q m + d, d = q n + d and d = q 3 m + d, d = q 4 n + d. Then m (q q 3 )m d d and n (q q 4 )n d d. Since (m, n) = so mn d d and so d d = 0 because 0 < d, d mn. It is surjective: Given d, d with d m, (d, m) = and d n, (d, n) =, let d = d ny + d mx + zmn where mx + ny = and z is an integer such that 0 d < mn. Writing ny = mx we have d = d + (d d )mx + zmn and so and similarly by writing mx = ny we have So d (d, d ). Finally, and d = ((d d )x + zn)m + d d = (d d )y + zm)n + d. (d, m) = (d ny, m) = (d d mx, m) = (d, m) = (d, n) = (d mx, n) = (d d ny, n) = (d, n) = so (d, mn) =. So d is the reimage of (d, d ). By comaring the sizes of the two sets we conclude that φ is multilicative. Corollary.. Let n = i a i i. Then φ(n) = ai ( i ). i Proof. Since φ is multilicative, it suffices to show that φ( a ) = a ( ) for any rime. Indeed, for any n, (n, a ) = if and only if (n, ) =. Since the number of ositive integers less than a which are divisible by is a, so φ( a ) = a a = a ( ). Note that this also shows φ(n) is always even for all n >. Indeed, (a, n) = if and only if (n a, n) =. Corollary.3. We have an identity φ(d) = n. d n Proof. Since φ is multilicative, then d n φ(d) is also multilicative and so it suffices to show that φ(d) = a d a for any rime. Indeed, d a φ(d) = a φ( i ) = + ( i i ) = a. i= i=0 Remark.4. One can show the above identity directly by considering the bijection and d n φ(d) = d n φ ( n d ). {c N : c d, (c, d) = } {c N : c n, (c, n) = n d }, c cn d 9

.4 The function σ(n) Definition.5. The function σ(n) is defined to be the sum of all ositive factors of n. In other words, σ(n) = d n d. Lemma.6. σ(n) is multilicative. Proof. By Lemma.7, for all (m, n) = we have σ(mn) = d = d d = d d = σ(m)σ(n). d mn d m,d n d m d n Corollary.7. Let n = i a i i. Then σ(n) = i ( a i+ i )/( i ). Proof. It suffices to show that for all rimes. Indeed, σ( a ) = ( a+ )/( ) a σ( a ) = i = ( a+ )/( ). i=0.5 The Mobius function µ(n) Definition.8. The Mobius function µ(n) is defined to be if n =, 0 if n is divisible by for some rime, and ( ) k if n = k where,..., k are distinct rimes. Lemma.9. µ(n) is multilicative. Proof. For all (m, n) = if one of m, n is divisible by for some, so is mn. If m, n are both square free, (i.e. not divisible by for any rime) then mn is also square free. Since ( ) k +k = ( ) k ( ) k so µ is multilicative. Corollary.0. Let ν(n) = d n µ(d). Then ν is multilicative and ν(n) = if n = and ν(n) = 0 for all n. Proof. By the revious lemma and Lemma.9, ν is multilicative. If n = then ν() = µ() =. For any rime, ν( a ) = d a µ(d) = + 0 + 0 + = 0. Therefore ν(n) = 0 for all n. Definition.. Let f, g be real functions defined on ositive integers. The convolution of f and g, written f g is defined to be f g(n) = f(d)g(n/d). d n By convention, the function (n) is defined to be (n) = for all n. Therefore, d n f(d) can be written as f. Lemma.. f g = g f for any f and g. Further, (f g) h = f (g h) for any f, g and h. 0

Proof. For any f and g, f g = d n f(d)g(n/d) = d n f(n/d)g(d) = g f. For any f, g and h, we have (f g) h = (f g)(d)h(n/d) = d n d n = f(e)g(e )h(d ) dd =n ee =d = ee d =n f(e)g(e )h(d ). f(e)g(d/e)h(n/d) e d Since f (g h) = (g h) f, by symmetry and so (f g) h = f (g h). (g h) f = ee d =n f(e)g(e )h(d ) Theorem.3 (Mobius Inversion Formula). Let f be any real function defined on ositive integers (not necessarily multilicative), and let g = f. Then f = g µ. Conversely, if f = g µ then g = f. Proof. We have g µ = g(n/d)µ(d) = d n d n = f(e)µ(d) dd =n e d = f(e)µ(d) dee =n f(e)µ(d) e n/d = f(e) µ(d) = f(e)ν(n/e) = f(n). e n d n/e e n Conversely, if f = g µ then f = f(d) = d n d n = g(e)µ(e ) dee =n g(e)µ(d/e) e d = g(e)ν(n/e) = g(n). e n The following is the multilicative version of Mobius inversion. Corollary.4. If F (n) = d n f(d), then f(n) = d n F (d)µ(n/d).

Proof. Let G(n) = log F (n) and g(n) = log f(n). Then G(n) = d n g(d) and so by Mobius inversion formula g(n) = d n G(d)µ(n/d). Therefore, f(n) = ex g(n) = d n F (d) µ(n/d)..6 Estimate Often we want to estimate n x f(n), where x R. Definition.5. For any real function f(x), g(x) = O(f(x)) is a quantity such that there exist ositive constants c, M such that g(x) c f(x) for all x M. In other words, g(x)/f(x) is bounded. The little o notation h(x) = o(f(x)) means that h(x)/f(x) 0 as x. The asymtotic notation r(x) f(x) means that r(x)/f(x) as x. We shall give several examles. Proosition.6. n x τ(n) = x log x + O(x). Proof. We have n x τ(x) = n x = d n dm x = d x[x/d] = d x But d x /d = log x + O() by using integral aroximation so τ(n) = x log x + O(x). n x x/d + O(x). Therefore the average order of τ is about log x. Proosition.7. π n x σ(n) = x + O(x log x). Proof. We observe that n x σ(n) = n x d = d n dm x d = m x d x/m d. Since we have d = [x/m]([x/m] + ) = (x/m) + O(x/m), d x/m d = ( (x/m) + O(x/m)) x m + O(x/m). m x d x/m m x m x m x

We have seen in the revious roosition m x O(x/m) = O(x log x). Finally we use the fact that m x m = m + O(/x) m= and the result follows by the identity m= = π /6. m Proosition.8. n x φ(x) = 3 π x + O(x log x). Proof. We have n x φ(n) = n x µ(d)(n/d) = µ(d)e = µ(d) e. de x d x Since we have seen that e x/d e = (x/d) + O(x/d), so µ(d) d x d n e x/d e = x / d x µ(d)(/d) + x d x e x/d µ(d)o(/d). But d x µ(d)/d = d= µ(d)/d + O(/x). We wil show later that d= µ(d)/d = 6/π. So we conclude that φ(n) = 3 π x + O(x log x). n x Corollary.9. The robability of two randomly selected ositive integers being corime is 6 π. Proof. For each ositive integer x, the sum n x φ(n) is the number of unordered airs of corime integers a, b with 0 < a, b x. There are ( x ) ways to select two ositive integers a, b with 0 < a, b x. So the robability that two randomly selected integers less than or equal to x being corime is n x φ(n). By the revious roosition and let x we conclude that ( x ) lim x n x φ(n) ( x ) = 6 π..7 Dirichlet series We introduce Dirichlet series of the form f(n) n= n s convention, we write s = σ + it with σ, t R. where f(n) Z for each n and s C. For Definition.30. The Riemann zeta-function ζ(s) is defined to be It converges absolutely for σ >. ζ(s) = Proosition.3. Given Dirichlet series F (s) = n f(n)/ns and G(s) = n g(n)/ns, if F (s), G(s) both converge absolutely for s S for some S. Then F (s)g(s) = n (f g)(n)/ns for s S. n= n s. 3

Proof. Since F, G both converge absolutely so we are free to rearrange the sum. Indeed, we have F (s)g(s) = f(k)/k s g(m)/m s = f(k)g(m)/(km) s = f(k)g(n/k)/n s. k m m,k n k n Corollary.3. ζ(s) = n µ(n)/ns for σ >. In articular, n µ(n)/n = 6/π. Proof. It suffices to rove that ζ(s) n µ(n)/ns =. Since ζ(s) and n µ(n)/ns both converge absolutely for σ > and so ζ(s) n µ(n)/n s = n ( µ)(n)/n s = n ν(n)/n s =..8 Exercises. Show that the number of ordered airs of ositive integers whose least common multile is n equals τ(n ).. Show that d n µ(d) = µ(n). 3. Show that if σ(n) is odd then n is a square or twice a square. 4. For each n, show that if and only if n is a rime. σ(n) + φ(n) = nτ(n) 5. For each n, let T (n) = {a : a n, (a, n) = } and f(n) = n a T (n) a. (i) Show that f(n) = φ(n). (ii) By evaluating a a n in two different ways, show also that n (d!/d d ) µ(n/d). a T (n) a = n φ(n) d n 6. If n has k distinct rime factors then d n µ(d) = k. 7. Find all ositive integers n such that (i) φ(n) n (ii) φ(n) = n (iii) φ(n) = φ(n). 8. For R(s) >, comute the Dirichlet series of (i) ζ(s) (ii) /ζ(s) (iii) ζ(s )/ζ(s). 9. Let A be the matrix with A ij = (i, j). (i) Let g(i, j) = if j i and 0 otherwise. Show that A ij = d n g(i, d)g(j, d)φ(d). (ii) By considering the matrices B, C where B ij = g(i, j) and C ij = g(j, i)φ(i) Show that det A = 4 n φ(k). k=

0. (i) Prove the following generalised version of Mobius inversion formula. Let f, g be functions defined over R. Show that if g(x) = n x f(x/n), then f(x) = n x µ(n)g(x/n). (ii) Show that n x µ(n)[x/n] =. Hence rove that n x µ(n)/n. 5

3 Congruences In this chater we will introduce the concet of congruences. We shall assume n. 3. Definition Definition 3.. We say a is congruent to b mod n, written a b mod n if n a b. It is easy to check that this is an equivalence relation. Lemma 3.. If a a mod n and b b mod n then a + b a + b mod n and ab a b mod n. For any integer c, ca ca mod n. Conversely, if ca ca mod n and (c, n) =, then a a mod n. Further, if f is a olynomial with integer coefficients, then f(a) f(a ) mod n. Proof. The first statement is clear because if n a a, n b b then n (a + b) (a + b ). Now ab a b = ab ab + ab a b = a(b b ) + (a a )b so n ab a b. It is clear that if n a a then n ca ca for any c. Conversely, if n c(a a ) and (c, n) = then n a a. Finally, n a a f(a) f(a ) for any olynomial f with integer coefficients. Definition 3.3. Let n be a ositive integer. Z/nZ is the quotient ring so that addition and multilication can be understood in terms of modular arithmetic. That is, (a + nz) + (b + nz) = (a + b) + nz, (a + nz)(b + nz) = ab + nz. Lemma 3.4. The followings are equivalent. (i) (a, n) =. (ii) There exists x such that ax mod n. (iii) a is a generator for the additive grou Z/nZ. Proof. We shall rove (i) imlies (ii), (ii) imlies (iii) and (iii) imlies (i). If (a, n) = then there exist x, y such that ax + ny = and so ax mod n. Suose there exists x such that ax mod n and so there exists y such that ax + ny =. Let d be the order of a in Z/nZ and so n ad. Since axd+nyd = d and n axd, n nyd so n d. Therefore d = n. Finally, if a generates Z/nZ and (a, n) = d >. Then n n a and so the order of a is at most d < n which is a contradiction. n d Lemma 3.5. The multilicative grou of the quotient ring Z/nZ, written (Z/nZ), has size φ(n). Proof. a (Z/nZ) if and only if there exists x such that ax mod n, if and only if (a, n) = by the revious lemma. Corollary 3.6. Z/nZ is a field if and only if n is rime. Proof. Z/nZ is a field if and only if every non-zero element is a unit, if and only if φ(n) = n, if and only if n is a rime. Corollary 3.7 (Fermat Euler theorem). For any (a, n) =, we have In articular, if a, then a mod. a φ(n) mod n. Proof. Since (Z/nZ) has size φ(n), so a φ(n) mod n. 6

3. Chinese remainder theorem Lemma 3.8. The linear congruence ax = b mod n is soluble for some integer x if and only if (a, n) b. Proof. Suose such x exists, then n ax b and so (a, n) n ax b. Since (a, n) ax so (a, n) b. Conversely, if (a, n) b then there exist x, y such that ax + ny = (a, n) and so and so ax b (a,n) b mod n. ax b (a, n) + ny b (a, n) = b We now turn to simultaneous linear congruences. Theorem 3.9 (Chinese remainder theorem). Let n,..., n k be natural numbers and suose that they are airwise corime, that is (n i, n j ) = for all i j. Then, for any c,..., c k, the congruences x c j mod n j with j k are soluble simultaneously for some integer x. The solution is unique modulo n = i n i. Proof. Existence: Let n = i n i and m j = n/n j. Then n i m j for all i j and m j is corime to n j. So there exists x j such that m j x j c j mod n j by the revious lemma. Let x = j x j m j. Then x c j x j m j c j mod n j. Uniqueness: Suose x, y both satisfy the condition. Then n j x y for all j and so n x y. Here is another version of Chinese remainder theorem. Corollary 3.0. Let n = m m k where m,..., m k are airwise corime. Then we have a ring isomorhism Z/nZ = Z/m i Z, a + nz a + m i Z. i i In articular, we have a grou isomorhism (Z/nZ) = (Z/m i Z) and this gives another roof that φ is multilicative by comaring the sizes of the grous. Proof. It is clearly a well-defined ring homomorhism. Injectivity follows from the uniqueness of Chinese remainder theorem and surjectivity follows from the existence of Chinese remainder theorem. i 3.3 Wilson s theorem Theorem 3.. For any rime, ( )! mod. Proof. For each a, a mod if and only if (a )(a+), if and only if a ± mod. Therefore, if a ± mod, then there exists b a mod such that ab mod. So ( )! ( ) mod. 7

Corollary 3.. Let be an odd rime. There exists x such that if and only if mod 4. Proof. Suose there exists x such that Then x mod x mod. x = (x ) ( ) mod. This imlies that is even and so mod 4. Conversely, suose mod 4. Let r = and so r is even. Then ( )! (r!) ( ) r (r!) mod where we write every integer i between r + and as j for some j r. 3.4 Lagrange s theorem Definition 3.3. Let R be a (commutative) ring. We write R[X] to be the olynomial ring consisting olynomials of the form a 0 + a X + a n X n, n Z 0, a i R. Remark 3.4. The ma R[X] {functionsr R}, f (α f(α)) is not always surjective. For examle, R = Z/Z and f = X X. Then f(α) = 0 for all α R by Fermat Euler theorem. But f 0 in R[X]. Lemma 3.5 (Division Algorithm). Let f, g R[X]. Suose the leading coefficient of g is a unit in R, then there exist q, r R[X] with deg(r) < deg(g) such that f = gq + r. Proof. If deg f < deg g then the result is obvious. Let deg f deg g and let n = deg f deg g. Let a be the leading coefficient of f and b be the leading coefficient of g. Since b is a unit, there exists c R such that bc = a. Then f = f cgx n has degree less than f. Now reeat the above for f and g. Thus, we obtain a sequence f = gq + f, f = gq + f,... Therefore, f = g( i q i) + f k. deg f deg f deg f deg g f k = gq k + f k, deg f k < deg g. Corollary 3.6. If f R[X] has a root α R. Then f(x) = (X α)q(x) for some q(x) R[X]. Proof. Aly division algorithm for f and X α so f(x) = (X α)q(x) + r(x), deg r(x) < deg X α. Therefore r(x) has degree 0 and so r(x) is a constant in R. Since f(α) = 0 so r(α) = 0 and so r(x) = 0. 8

Theorem 3.7 (Lagrange s theorem). Let R be an integral domain (that is, ab = 0 if and only if a = 0 or b = 0) and f R[X] of degree n and f 0. Then f has at most n roots in R. Proof. We rove the theorem by induction on n = deg f. If n =, then f = ax b for some a, b R and so either f has no root of x = b/a is the only root. Suose the statement is true for n. Now let deg f = n +. If f has a root α then by the revious corollary, there exists q(x) such that f(x) = (X α)q(x). Then deg q(x) = n and so it has at most n roots. Therefore, f has at most n + roots. Remark 3.8. By considering R = Z/Z, f(x) = X i= (X i), we have another roof of Wilson s theorem by using Lagrange s theorem. Indeed, f has degree at most but X =,..., are roots of f. Therefore, f = 0 by Lagrange s theorem. By considering the constant term we have ( )! mod. 3.5 Primitive roots We will show that (Z/ n Z) is cyclic for all odd rime. Lemma 3.9. For each rime, (Z/Z) is cyclic. Proof. Each element a (Z/Z) satisfies a =. So the order of a is d for some d. Let S d be the set of elements with order d. Suose S d. Let a S d and let G d be the subgrou generated by a. Then G d = {, a,..., a d }. Let R = Z/Z and f(x) = X d. Every element of order d is a root of f. By Lagrange s theorem f has at most d roots. But each element in G d is a root of f and so these are all the roots of f. Therefore each element of order d is a i for some i < d. Since G d = Z/dZ via a i i. By Lemma 3.4, we conclude that (i, d) =. So S d = φ(d). Therefore S d = 0 or φ(d). Recall that d φ(d) =, so φ(d) = = S d. d This shows that S d = φ(d) for all d and so in articular S = φ( ), which means there exists an element of order. Theorem 3.0. (Z/ n Z) is cyclic for all odd rime. We will rove this by several lemmas. Lemma 3.. For each n, g generates (Z/ n Z) if and only if g generates (Z/Z) and g n ( ) mod n. Proof. Suose g generates (Z/ n Z), then clearly g n ( ) mod n. Let d be the order of g in (Z/Z) and so g d = + z for some z. Then d g dn mod n and so the order of g in (Z/ n Z) is less than d n which is a contradiction. Conversely, let g be a generator of (Z/Z) and g n ( ) mod n. Let d be the order of g in (Z/ n Z). Since φ( n ) = n ( ), so d n ( ). Also g d mod n imlies that g d mod. So d and so d = ( ) k for some k. But g n ( ) mod n so k > n and so k = n. Therefore d = φ( n ). 9

Lemma 3.. For each odd rime, (Z/ Z) is cyclic. In articular, g generates (Z/Z) and g mod, if and only if g is a generator for (Z/ Z). Proof. Consider the natural reduction (Z/ Z) (Z/Z), a + Z a + Z. It is clearly surjective. By considering the sizes of the grous, the kernel is a subgrou of order and so it must be cyclic. Therefore, we have an element of order and an element of order, so we obtain an element of order ( ). We now rove Theorem 3.0. Proof. Let g be a generator of (Z Z). So g is a generator of (ZZ) and g mod. Let g = + z where (z, ) =. Then for each k, g k ( ) = ( + z) k + k+ z mod k+. In articular, g k ( ) mod k+. Let k = n and aly Lemma 3.. Remark 3.3. The roof of the theorem imlies that g is a generator of (Z/ n Z) if and only if g is a generator of (Z/ Z), if and only if g is a generator of (Z/Z) and g = + z where (z, ) =. Remark 3.4. Theorem 3.0 is not true for =. For examle, (Z/ 3 Z) = (Z/Z). 3.6 Chevalley s theorem We briefly discuss the congruence of general olynomials mod. Throughout, let be a rime and R = Z/Z. Definition 3.5. For any f, g R[X,..., X n ], we say f is equivalent to g, (written f g) if for all (a,..., a n ) R n. f(a,..., a n ) = g(a,..., a n ) Examle 3.6. Note that f g does not imly f = g. For examle, X X X + X but X X X + X. Definition 3.7. For any f R[X,..., X n ], f is called reduced if f has degree less than in each variable X i. Lemma 3.8. For each olynomial f R[X,..., X n ] there exists a reduced olynomial f such that f f. Proof. Relace X d i i by r i in f where d i = q i + r i, 0 r i <. and let f be the olynomial after this reduction. Then f is reduced and f f. Lemma 3.9. For any f, g R[X,..., X n ], if f and g are both reduced and f g, then f = g. Proof. By considering f g, we can assume that g = 0 and so it suffices to rove that if f is reduced and f 0 then f = 0. When n = the result follows by Lagrange s theorem. Suose this is true for n. Then for n +, consider f as a olynomial in R[X,..., X n ][X n+ ]. Write f = b m X m n+ + + b 0, where b i R[X,..., X n ]. 0

Suose b i 0, then there exists a,..., a n such that b i (a,..., a n ) 0 and so for this (a,..., a n ), the olynomial f(a,..., a n, X n+ ) = b m (a,..., a n )X m n+ + + b 0 (a,..., a n ) is a non-zero olynomial in R[X n+ of degree less than. But every element in R is a root of the above olynomial by assumtion because f 0, so this gives a contradiction. Therefore, b i 0 for all i. By inductive hyothesis, b i = 0 for each i and so f = 0. Theorem 3.30 (Chevalley s theorem). Let f R[X,..., X n ] and deg f < n. (i) If f has a solution, then f has at least two solutions. (ii)if f is homogenous, (that means, each monomial in f has the same degree) then f has a non-trivial solution. Proof. (i) Let r = deg f < n and h = f. If X i = a i, i =,..., n is a solution of f then h(a,..., a n ) =. Suose f has no other root, then for any other values x,..., x n R, f (x,..., x n ) = and so h(x,..., x n ) = 0. By Lemma 3.8, there exists a reduced olynomial h such that h h. Define a reduced olynomial n h (X,..., X n ) = ( (X i a i ) ). i= Then clearly h h and so h h. Since h, h are reduced, then by the revious lemma, we conclude that h = h. Now h has degree r( ). Since h h and h is reduced so deg h r( ) < n( ) = deg h which gives a contradiction. Therefore f has at least two solutions. (ii) Since f is homogenous then (0,..., 0) is a solution and so by (i), f has a non-trivial solution. 3.7 Exercises. Prove that if (a, m) = (a, m) =, then φ(m) i=0 a i 0 mod m. Let S = {,,,...} and is a rime, 5. Show that there are infinitely many elements in S which are divisible by. Show that a k k+ a mod for all rimes, integers a and ositive integers k. Deduce that 798 divides a 9 a for all integers a. 3. Show that if m > 4 then (m )! mod m if and only if m is a rime. Show further that if is an odd rime and 0 < k < then ( k)!(k )! ( ) k mod. 4. Show that if (m, n) = then m φ(n) + n φ(m) mod mn.

5. (i) Prove that for a rime > 3 then roduct of all the distinct rimitive roots mod is congruent to mod. (ii) Prove that for any rime, the sum of all the distinct rimitive roots mod is congruent to µ( ) mod. 6. Find a counter examle for Lagrange s theorem when R is not an integral domain. 7. For each odd rime and n, show that the kernel of the natural reduction (Z/ n Z) (Z/Z) is cyclic. This gives another roof that (Z/ n Z) is cyclic. By considering the natural reduction (Z/ n Z) (Z/4Z) where n, show that (Z/ n Z) = (Z/Z) (Z/ n Z). 8. Let a and n be integers greater than, and ut N = a n. Show that the order of a + NZ in (Z/NZ) is exactly n and deduce that n φ(n). If n is a rime, deduce that there are infinitely many rimes q such that q mod n. 9. Show that for any odd rime, 0. Let be a rime > 3, by considering + i i of u = + + + is divisible by. 3 5 ( ) ( ) + mod. for each i ( )/, show that the numerator

4 Quadratic Residues We shall study the quadratic congruences x a mod n. 4. Legendre s symbol Definition 4.. Let a Z and n N such that (a, n) =. a is called a quadratic residue (QR) mod n if the congruence x a mod n has a solution. Otherwise a is called a quadratic non-residue (QNR). Note that if a n then x a mod n is also soluble (though in this case a is not a QR mod n by definition). ( Definition 4.. Let be a rime. The Legendres symbol if a is a QNR mod, and 0 if a. Clearly, if a b mod, then ( ) ( ) a b =. a ) is defined as if a is a QR mod, Lemma 4.3. For each n, the set of QR mod n forms a grou under multilication. Proof. is a QR mod because mod. If x a mod n and y b mod n then If x a mod n then x a mod n. (xy) ab mod n. Lemma 4.4. For each n >, the set of QR mod n has size φ(n)/t(n) where t(n) is number of elements x (Z/nZ) such that x mod n. In articular, the set of QR mod has size ( )/ for any odd rime. Proof. The ma (Z/nZ) (Z/nZ), x x is a grou homomorhism and the image is the set of QR. The kernel is the set of elements x such that x mod n. The result follows from isomorhism theorem. 4. Euler s criterion Theorem 4.5 (Euler s criterion). Let be an odd rime and a Z. Then ( ) a a mod. Proof. Let g be a generator for (Z/Z). Then g k, k =,..., ( )/ are QR mod. Since there are ( )/ QR mod so these are all the QR mod and so every QNR has the form g k+ for some k. If a is a QR mod then a = g k and so ( ) a = g k( ) = a ( )/ mod. Since x mod if and only if x ± mod, so g ( )/ mod. Therefore, if a is a QNR and a = g k+ for some k, then ( ) a = g k( )+( )/ = a ( )/ mod. 3

Corollary 4.6. For all integers a, b and odd rime, ( ) ( ab a = In articular, the ma χ : (Z/Z) {±}, ) ( b is a grou homomorhism with kernel the set of QR mod. Proof. By Euler s criterion, ( ) ab ab ( )/ a ( )/ b ( )/ ( ) ( ) ( ) ab a b Since they are both ± so =. ). a ( a ( ) a Corollary 4.7. is a square mod if and only if mod 4. Proof. Aly Euler s criterion with a =. We give some alications of the above corollary. Proosition 4.8. Let be an odd rime. Then (i) ( ) a a= = 0. (ii) ( ) a= a a 0 mod if > 3. (iii) ) a= =. ( a(a+) Proof. (i) Let b be a QNR mod (which exists as > ). Then is a bijection. So and so a= ( a ) = 0. a= a= (Z/Z) (Z/Z), ( ) a = a= ( ) ab = a ab ( ) b a= ) ( ) b ( ) a mod. (ii) Since > 3, we ick b ±, 0 mod, and by the above bijection we have ( ) a ( ) ab ( ) a a ab ±b a mod and so Therefore, ( ) a= a a 0. (iii) There is a bijection So we have a= a= a= ( ) a a ( ± b) 0 mod. (Z/Z) (Z/Z), a a. ( ) a(a + ) ( ) ( ) a + a = = a= where in the last ste we set b = + a. Then by (i) ( ) b ( ) b = =. b= a= b= b= ( ) b 4

4.3 Gauss s lemma Lemma 4.9 (Gauss s lemma). Let be an odd rime and a Z such that (a, ) =. Let a j be the integer such that a j aj mod and ( )/ a j ( )/. Then ( ) a = ( ) ν where ν is the size of {j : j ( )/, a j < 0}. Proof. For each i, j ( )/, if a i = ±a j, then (j ± i)a 0 mod. Since < j ± i < and (a, ) =, so j ± i 0 mod. Therefore, for all i j ( )/, a i a j. So { a,..., a ( )/ } = {,,..., ( )/}. Therefore, ( ) a ( )/! = j ( ) a j =!( ) ν where ν is the size of {j : j ( )/, a j < 0} and so the result follows by Euler s criterion. ( ) Corollary 4.0. = if and only if ± mod 8. Proof. Let a = and so a j = j for j [ ] and a 4 j = j for [ ] < j ( )/. So 4 ν = ( )/ [ ] and so ν is even if and only if ± mod 8. 4 4.4 Law of quadratic recirocity ( We shall study the relation between q ) ( and q ) for odd rimes and q. Theorem 4.. Let, q be distinct odd rimes. Then ( ) ( ) q = ( ) q. q We give a roof using Gauss s lemma. An alternative roof can be found in the Exercises. The first ste is to interret the number ν as in Gauss s lemma in another way. Lemma 4.. Let a,, ν be the numbers as in Gauss s lemma. Then ν = m i= [ ] i [ a ( ) i, where m =. a ] Proof. In Gauss s lemma, ν is the number of j such that aj is inside one of the intervals [/, ], [3/3, ],..., [(n /), n]. Therefore it is the number of j such that j is in one of the intervals [ a, ] [ 3, a a, 4 ] [ (n ),...,, n ]. a a a The end oints are not integers because (a, ) =. Since the number of integers inside an interval [α, β] with α, β Z is [β] [α], this roves the statement. 5

Lemma 4.3. Let, q be distinct odd rimes and a Z such that (a, ) = (a,( q) ) =. ( Let ) ν, ν be the numbers for, q resectively as in Gauss s lemma. If ±q mod 4a, then =. Proof. By Gauss s lemma, it suffices to rove that ν and ν have the same arity. Suose q mod 4a, then [ ] [ i a and iq a] have the same arity for all i. Then by the revious lemma, ν, ν have the same arity. Suose q mod 4a, then [ ] [ i a and iq ] a have the same arity. Since [ α] = [α] for all real number α and so [ ] [ i a and iq a] have different arity. Therefore again by the revious lemma, ν and ν have the same arity. We now rove law of quadratic recirocity. Proof. Suose q mod 4 then 4 + q and let + q = 4a for some a. Then ( ) ( ) ( ) 4a q a = = q q q and ( ) q = By the revious lemma, since q mod 4a, so ( ) ( ) a = = q q ( So and q ) ( q ) = if + q 0 mod 4. ( ) 4a = ( ) a = ( ) a ( ) q. Suose now q mod 4, then 4 q and let q = 4a for some a. Then ( ) ( ) ( ) 4a + q a = = q q q ( ) q = By the revious lemma, since q mod 4a so ( ) ( ) ( ) a a = = q q ( So q ) ( q ( ) ( ) 4a a = = ( ) ( )/ ( q ) = if q mod 4 and if q 3 mod 4. Corollary 4.4. 3 is a quadratic residue mod if and only if mod 3. Proof. By law of quadratic recirocity, we have ( ) ( ) ( ) 3 3 ( ) = = ( ) ( )/ ( ) ( )/ = 3 ( ) 3 Therefore = if and only if ( 3) =, if and only if mod 3. ). ( 3). a a q 6

4.5 Jacobi s symbol This is a generalisation of Legendre s symbol. Definition 4.5. Let n > be a ositive odd integer and n = i i as a roduct of rimes, not necessarily distinct. Then for any integer a, the Jacobi s symbol ( a n) is ( a = n) ( ) a. i i Remark 4.6. The above definition imlies that ( a ) n) = 0 if (a, n) >. Also by convention we define = if n =. It is clear that if a b mod n then ( a n ( a = n) ( ) b. n Remark 4.7. ( a n) = does not imly a is a square mod n. For examle, if a = and n = 5 then ( ) ( ) ( ) = = ( )( ) =. 5 3 5 But if is a square mod 5 then is a square mod 3, which is a contradiction. But if ( a n) = then a is a QNR mod n because by definition, ( ) ( ) a n = imlies a = for some rime n. So a is a QNR mod and hence a QNR mod n. Proosition 4.8. Let n be a ositive odd integer. ( n) = if and only if n ± mod 8. Proof. Let n = i i and so ( ) = n i ( ) = ( ) t where t is the number of i such that i ±3 mod 8. So t is even if and only if n ± mod 8. Theorem 4.9 (Law of quadratic recirocity for Jacobi s symbol). Let m, n be odd ositive integers such that (m, n) =. Then ( m ) ( n = ( ) n m) m n. i Proof. Let n = i i and m = j q j where i q j for all i, j. Then ( m ) ( n = n m) i j ( i q j ) ( ) qj = i i j ( ) i q j = i ( ) a ij j where a ij = if i q j 3 mod 4 and a ij = otherwise. Therefore, i j ( )a ij = ( ) uv where u is the number of i such that i 3 mod 4 and v is the number of q j such that q j 3 mod 4. Note that u is even if and only if n mod 4 and v is even if and only if m mod 4. So uv has the same arity as m n. 7

4.6 Hensel s lemma We want to determine whether a is a QR mod n for given integers a and n. By Chinese remainder theorem, if n = i a i i then a is a QR mod n if and only if a is a QR mod a i i for each i. Theorem 4.0 (Hensel s lemma). For each odd rime, x is a QR mod if and only if x is a QR mod n for all n. Proof. If x is a QR mod n for all n then x is a QR mod. Conversely, if x is a QR mod, then we rove by induction that x is a QR mod n for all n. This is true for n =. Suose x is a QR mod n where n, then there exists y, k such that y = x + n k where (y, ) = because (x, ) =. We search for an element of the form y + n b such that (y + n b) mod n. Then we must have (y + n b) = x + n (k + by) + n b x mod n. Since n n so we need to ick b such that k + by 0 mod and so b y k. Such b exists because (, ) = and so exists. Proosition 4.. Let x be an odd integer. Then x is a QR mod n for all n if and only if x mod 8. Proof. If x is a QR mod n for all n then x mod 8 because 3 5 7 mod 8. Conversely, let x mod 8. Clearly, x is a QR mod, 4 and we rove by induction that x is a QR mod n for all n 3. It is clearly true for n = 3. Suose x is a QR mod n where n 4, then there exist integers y, k such that y = x + n k where y is odd. We search for an element of the form y + n b such that (y + n b) x mod n. Then we must have y + n by + n 4 b = x + n (k + by) + n 4 b x mod n. So it suffices to ick b such that k and b have the same arity. 4.7 Exercises. Show that if is a rime 3 mod 4 and if = + is a rime then mod. Deduce that 5 is not a Mersenne rime.. Show that if mod 4, then a QR Give a counter examle when 3 mod 4. a = ( ) = 4 a QNR a. 8

3. Let be a rime of the form n +. Show that a is a quadratic non-residue mod if and only if a is a rimitive root mod. 4. By considering integers of the form n +4, show that there are infinitely many rimes congruent to 5 mod 8. By considering n + and n, show further that there are infinitely many rimes congruent to 3 or 7 mod 8. 5. Let f(x) = ax + bx + c where a, b, c are integers, and let be an odd rime which does( not ) divide a. Prove that the number of solutions of the congruence f(x) 0 mod is + where d = b 4ac. 6. Show that an integer a is a square if and only if the congruence x a mod is soluble for every rime. 7. Let f(x) = ax + bx + c where a, b, c are integers. Let be an odd rime which does not divide a. Further let d = b 4ac. Show that if d then ( ) ( ) f(x) a =. Evaluate the sum when d. a= x= 8. Let be a rime with 3 mod 8. Show that ( ) ( )/ a ( ) a a = (a ) Deduce that if > 3 then a= ( )/ a= = ( )/ a= ( ) a 0 mod 3. 9. Let be an odd rime and ζ = e πi/. (i) Let ( ) a τ = ζ a. a= ( 4a) Show that τ = where = ( ) ( )/. ( ) (ii) Let q be an odd rime and q. Show that = if and only if q τ q mod q. ) mod q. Hence give an alternative roof for law of quadratic reci- ( (iii) Show that τ q rocity. q ( ) a. d 0. Prove the following general version of Hensel s lemma. Suose f(x) is a olynomial with integer coefficient and m, k are ositive integers such that m k. If r is an integer such that f(r) 0 mod k andf (r) 0 mod then (by considering Taylor exansion) there exists an integer s such that f(s) 0 mod k+m and r s mod k. In articular, setting f(x) = x a and aly this reeatedly gives the Hensel s lemma in the last section. 9

5 Binary quadratic forms 5. Sum of two squares Which ositive integers can be written as sum of two squares? By studying the Gaussian integers Z[i], we know that a rime is a sum of squares if and only if mod 4 or =. What about comosite numbers? mod 4, but it cannot be written as sum of two squares. So we might need some more condition for comosite numbers. Theorem 5.. Let n be a ositive integer. n is the sum of two squares if and only if every rime number n with 3 mod 4 divides n to an even ower. Proof. Suose n = x + y for some x, y and n where 3 mod 4. Then x y mod. Since is not a square mod, so we must have x y 0 mod. This means x, y and so x + y. Then n / is a sum of two squares and we reeat the above until n. Therefore divides n to an even ower. Conversely, let n = mb where m is square free. It suffices to rove that m can be written as a sum of two squares. If n where 3 mod 4 then divides n to an even ower. Therefore, m and so if m then = or mod 4. Each such can be written as sum of two squares, and since (x + y )(x + y ) = (xx + yy ) + (xy yx ) so m can be written as a sum of two squares. 5. Definition and equivalence Definition 5.. f(x, y) is called a binary quadratic form if f(x, y) = ax + bxy + cy, where a, b, c Z. The discriminant of f is d = b 4ac. An integer n is reresented by f if there exist integers x and y such that f(x, y) = n. An integer n is roerly reresented by f if there exist integers x and y where (x, y) = such that f(x, y) = n. Remark 5.3. The discriminant d of a binary quadratic form is congruent to either 0 or mod 4 and d has the same arity as b. Definition 5.4. The forms x 4 dy for d 0 mod 4 and x + xy + 4 ( d)y for d mod 4 are called the rincial forms with discriminant d. Therefore for each d 0, mod 4 there exist a binary quadratic form with discriminant d. Note that 4af(x, y) = (ax + by) dy and so if d < 0 the values taken by f are of the same sign and if d > 0 then f takes values of both signs. Indeed 4af(, 0) > 0 and 4af(b, a) = 4a y < 0. Definition 5.5. A binary quadratic form is called ositive definite if a > 0, d < 0 and negative definite if a < 0, d < 0. It is called indefinite if d > 0. We will mainly focus on ositive definite binary quadratic forms in this chater. Remark 5.6. We can write f as (a, b, c) or in matrix notation as M f = ( x y ) ( ) ( ) a b/ x. b/ c y Then the discriminant d is 4 det M f 30

When do two binary quadratic forms f and g reresent the same numbers? Definition 5.7. A unimodular substitution is one of the form X = αx + γy, Y = βx + δy where α, β, γ, δ Z and αδ βγ =. Definition 5.8. Two binary quadratic forms f, g are equivalent (written f g) if they are related by a unimodular substitution. It is not hard to check that is an equivalence relation. Lemma 5.9. In matrix notation, if f(x, y) = ax + bxy + cy and where α, β, γ, δ Z and αδ βγ =. Then ( A ) B/ B/ C ( ) α γ where T = SL β δ (Z. Proof. Write ( X Y ) ( ) x = T. y g(x, y) = g(αx + γy, βx + δy) = Ax + Bxy + Cy ( ) a b/ = T t T b/ c Corollary 5.0. Equivalent binary quadratic forms have the same discriminant and they reresent the same set of integers. Proof. Let M f and M g be the matrices for f and g resectively. Then M g = U t M f U for some U SL (Z). Therefore det M g = det M f. Since U is invertible so M f = (U t ) M g U so f and g reresent the same set of integers. Remark 5.. The converse of the above corollary is not true. For examle, f = (, 0, 6) and g = (, 0, 3) have the same discriminant but they are not equivalent. Indeed, f reresents but g(x, y) = x + 3y. 5.3 Reduction We have an equivalence relation for binary quadratic forms. It will hel to study the equivalence classes if we secify a secial form in each equivalence class. We begin with several examles. Examle 5.. If f(x, y) = ax + bxy + cy. Then g(x, y) = f(x + ty, y) = a(x + ty) + b(x + ty)y + cy = ax + (at + b) + (at + bt + c)y. It is clear that f g and by icking t = ±, we have We can also try the unimodular substitution and so (a, b, c) (c, b, a). The above examle shows that (a, b, c) (a, b ± a, a ± b + c). g(x, y) = f(y, x) = ay bxy + cx 3

Lemma 5.3. Every equivalence class of binary quadratic forms consists of a binary quadratic form (a, b, c) with b a and a binary quadratic form with a c. Definition 5.4. A ositive definite binary quadratic form is reduced if either a < b a < c or 0 b a = c. For examle, (, ±, 3) are both reduced. (,, ) is reduced but (,, ) is not reduced. Lemma 5.5. Every binary quadratic form is equivalent to a reduced form. Proof. Define the unimodular oerations S : (a, b, c) (c, b, a), T ± (a, b ± a, a ± b, c). If a > c, aly S to decrease a, while leaving b fixed. If a < c and b > a then aly T ± to decrease b while leaving a fixed. Reeat these stes so we eventually obtain a form with b a c. If b = a, then aly T + to relace (a, a, c) by (a, a, c). If a = c then aly S (if necessary) to ensure b > 0. The following lemma gives a useful algorithm to find reduced forms of discriminant d. Lemma 5.6. Let f = (a, b, c) be a reduced binary quadratic form of discriminant d. Then d b a < 3 and b d mod. Proof. We have b a c and so d = b 4ac ac 4ac 3a. Therefore a d 3. Since d = b 4ac so b and d have the same arity. Examle 5.7. If d = 4, then a and so a =. b = 0 and c = so the only reduced form of discriminant 4 is x + y. Reduced forms can be used to study integers reresented by binary quadratic forms. Corollary 5.8. A rime is a sum of two squares if and only if = or mod 4. Proof. If = then = +. If mod 4 then is a square mod 4 and so there exists u, v such that u = + v. Let f(x, y) = (, u, v) then d f = 4. Since there is only one reduced form of discriminant 4, so f (, 0, ) and so they reresent the same set of integers. In articular, is reresented by f and hence is reresented by (, 0, ). Here is a useful fact of reduced form. Lemma 5.9. The smallest three ositive integers roerly reresented by a reduced form f = (a, b, c) are a, b, a + c b. 3