THUE S LEMMA AND IDONEAL QUADRATIC FORMS

Similar documents
THUE S LEMMA AND IDONEAL QUADRATIC FORMS

QUADRATIC RINGS PETE L. CLARK

1. Factorization Divisibility in Z.

4400/6400 EXERCISES. 1. Homework 1

ALGEBRA HANDOUT 2.3: FACTORIZATION IN INTEGRAL DOMAINS. In this handout we wish to describe some aspects of the theory of factorization.

1. multiplication is commutative and associative;

Part II. Number Theory. Year

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

Summary Slides for MATH 342 June 25, 2018

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

Factorization in Polynomial Rings

NOTES ON FINITE FIELDS

MATH 361: NUMBER THEORY FOURTH LECTURE

Public-key Cryptography: Theory and Practice

Prime and irreducible elements of the ring of integers modulo n

18. Cyclotomic polynomials II

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

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

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Gaussian integers. 1 = a 2 + b 2 = c 2 + d 2.

M381 Number Theory 2004 Page 1

PRACTICE PROBLEMS: SET 1

Computations/Applications

AN EXAMINATION OF CLASS NUMBER FOR Q( d) WHERE d HAS CONTINUED FRACTION EXPANSION OF PERIOD THREE

LECTURE NOTES IN CRYPTOGRAPHY

AN EASY GENERALIZATION OF EULER S THEOREM ON THE SERIES OF PRIME RECIPROCALS

LEGENDRE S THEOREM, LEGRANGE S DESCENT

The primitive root theorem

EUCLIDEAN QUADRATIC FORMS AND ADC-FORMS: I

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

Mathematics for Cryptography

Homework 6 Solution. Math 113 Summer 2016.

Mathematical Olympiad Training Polynomials

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

Lecture Notes Math 371: Algebra (Fall 2006) by Nathanael Leedom Ackerman

PRACTICE FINAL MATH , MIT, SPRING 13. You have three hours. This test is closed book, closed notes, no calculators.

ECEN 5022 Cryptography

Beautiful Mathematics

MODEL ANSWERS TO HWK #10

HASSE-MINKOWSKI THEOREM

Math 109 HW 9 Solutions

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

Number Theory. Final Exam from Spring Solutions

4400/6400 EXERCISES. 1. Homework 1

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

RATIONAL QUADRATIC FORMS AND THE LOCAL-GLOBAL PRINCIPLE

IRREDUCIBILITY TESTS IN Q[T ]

(January 14, 2009) q n 1 q d 1. D = q n = q + d

NOTES ON SIMPLE NUMBER THEORY

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

Basic Algorithms in Number Theory

MATH 145 Algebra, Solutions to Assignment 4

Elementary Number Theory MARUCO. Summer, 2018

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

Number Theory Proof Portfolio

ON MONIC BINARY QUADRATIC FORMS

Predictive criteria for the representation of primes by binary quadratic forms

Quadratic reciprocity and the Jacobi symbol Stephen McAdam Department of Mathematics University of Texas at Austin

Factorization in Integral Domains II

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

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,

Math 2070BC Term 2 Weeks 1 13 Lecture Notes

Course 2316 Sample Paper 1

Solving the general quadratic congruence. y 2 Δ (mod p),

THE TRIANGULAR THEOREM OF THE PRIMES : BINARY QUADRATIC FORMS AND PRIMITIVE PYTHAGOREAN TRIPLES

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

Rational Points on Conics, and Local-Global Relations in Number Theory

32 Divisibility Theory in Integral Domains

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

Number Theory Solutions Packet

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

Elementary Number Theory Review. Franz Luef

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

FACTORIZATION OF IDEALS

Necessary and Sufficient Conditions for the Central Norm to Equal 2 h in the Simple Continued Fraction Expansion of 2 h c for Any Odd Non-Square c > 1

be any ring homomorphism and let s S be any element of S. Then there is a unique ring homomorphism

Polynomials, Ideals, and Gröbner Bases

6]. (10) (i) Determine the units in the rings Z[i] and Z[ 10]. If n is a squarefree

Groups, Rings, and Finite Fields. Andreas Klappenecker. September 12, 2002

Lecture 11 - Basic Number Theory.

Fermat s Little Theorem. Fermat s little theorem is a statement about primes that nearly characterizes them.

Perspectives of Mathematics

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES

Chapter 2. Divisibility. 2.1 Common Divisors

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

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

Discrete Logarithms. Let s begin by recalling the definitions and a theorem. Let m be a given modulus. Then the finite set

Lecture 7.5: Euclidean domains and algebraic integers

Winter Camp 2009 Number Theory Tips and Tricks

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?

5: The Integers (An introduction to Number Theory)

Introduction to Arithmetic Geometry Fall 2013 Lecture #2 09/10/2013

A Note on Cyclotomic Integers

Chapter 14: Divisibility and factorization

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

Eighth Homework Solutions

The Mass Formula for Binary Quadratic Forms

Contents. 4 Arithmetic and Unique Factorization in Integral Domains. 4.1 Euclidean Domains and Principal Ideal Domains

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

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Transcription:

THUE S LEMMA AND IDONEAL QUADRATIC FORMS PETE L. CLARK Introduction Recently I learned about Thue s Lemma, an elementary result on congruences due to the Norwegian mathematician Axel Thue (1863-1922). I searched through many introductory number theory texts and found that Thue s Lemma is covered in a few of them [Ore, Thm. 11-7], [AZ, Prop., Ch. 4], [Sho, Thm. 2.33] but I believe it is not well-known. These texts use Thue s Lemma (only) to prove Fermat s Two Squares Theorem, or more precisely to deduce it from the fact that if p 1 (mod 4), then 1 is a square mod p ( Fermat s Lemma ). To be sure, there are many other nice proofs of Fermat s Two Squares Theorem, so if this were the only use of Thue s Lemma then perhaps its relative obscurity would be deserved. The purpose of this paper is to show that in fact Thue s Lemma can be used to prove many other results on the representation of integers by binary quadratic forms. None of the results that we present here are new although some are difficult to find in the contemporary literature and many of them are theorems of Fermat, Euler or Lagrange, hence very old indeed. However, the more traditional proofs require some rudiments of the theory of binary quadratic forms or the arithmetic of quadratic rings, including some technicalities when Z[ D] is not the full ring of integers of Q( D). The proofs that I present here use only quadratic reciprocity. For certain small values of D e.g. D = 3 the proofs one gets this way seem more graceful than any I have seen before. Thus this paper is polemical as well as expository: I submit for your consideration the claim that Thue s Lemma should appear more prominently in elementary texts and courses. Acknowledgments: I wish to thank Mariah Hamel for introducing me to Thue s Lemma and the book proof of the Two Squares Theorem, Jonathan P. Hanke for several helpful conversations and Thomas Hagedorn for cociting me in his already completed work [Hag]. 1. Thue s Lemma Theorem 1. (Thue s Lemma) Let n be a positive integer, and let c be an integer which is relatively prime to n. Then there exist integers x and y such that (i) 0 < x, y n and (ii) x cy (mod n). Proof. The result holds when n = 1, so we may assume n > 1 and hence n > n. For each ordered pair (i, j) of integers with 1 i, j n +1, consider the integer Date: August 19, 2010. c Pete L. Clark, 2010. 1

2 PETE L. CLARK i cj. We have ( n + 1) 2 > n ordered pairs, so there exist (i 1, j 1 ) (i 2, j 2 ) such that i 1 cj 1 i 2 cj 2 (mod n). Put x = i 1 i 2 and y = j 1 j 2 ; then (ii) holds. Moreover, 0 x, y n < n, so x (resp. y) is 0 iff it is zero modulo n. By construction x and y are not both 0, and by (ii) if one is zero modulo n so is the other. So both x any y are nonzero. 2.1. Quadratic reciprocity law. 2. Some preliminaries Recall that for an integer n and an odd prime p, the Legendre symbol ( n p ) is defined to be 0 if p n, 1 if gcd(p, n) = 1 and n is a square modulo p and 1 if n is not a square modulo p. Theorem 2. (Quadratic Reciprocity) Let l and p be distinct odd primes. Put l = ( 1) l 1 2 l. Then: a) ( 1 p ) = 1 p 1 (mod 4). b) ( 2 p ) = 1 p ±1 (mod 8). c) ( l p ) = ( p l ). Proof. See e.g. [HW6ed, Thms. 86, 94, 98] [IR, 5.2, Thm. 1] or [QR]. 2.2. Binary quadratic forms. By a binary quadratic form we mean a polynomial with A, B, C Z. q(x, y) = Ax 2 + Bxy + Cy 2 We say that an integer m is represented by q or, more informally, of the form q(x, y) if there exist integers x, y such that q(x, y) = m. An integer n is primitively represented by q if there exist x, y Z with gcd(x, y) = 1 such that q(x, y) = n. A quadratic form q(x, y) is primitive if gcd(a, B, C) = 1. When considering integer reperesentations, it is no loss of generality to restrict to the primitive case. A quadratic form q is anisotropic if for all (x, y) Z 2, q(x, y) = 0 = (x, y) = (0, 0). We will only be interested in anisotropic forms here. In fact, we will almost entirely be concerned with forms satisfying the stronger property that for all x, y R, q(x, y) 0, with equality iff (x, y) = (0, 0). Such forms are called positive definite. 1 A quadratic form is indefinite if there exist (x 1, y 1 ), (x 2, y 2 ) R 2 such that q(x 1, y 1 ) > 0 and q(x 2, y 2 ) < 0. 1 Negative definite forms are defined in the obvious way but not usually studied, since replacing q with q we get back to the positive definite case.

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 3 The discriminant of Q(x, y) is defined as = B 2 4AC. Evidently 0, 1 (mod 4). Conversely, given any integer 0, 1 (mod 4), there exists a binary quadratic form of discriminant. Indeed, if = 4D then the quadratic form q (x, y) = x 2 Dy 2 has discriminant 4D; whereas if 1 (mod 4), the quadratic form q (x, y) = x 2 + xy + 1 y 2 4 has discriminant. The forms q are called principal. Proposition 3. Let Q(x, y) be a quadratic form of discriminant ; let n Z\{0}. a) If n is squarefree, then all representations of n by Q(x, y) are primitive. b) If Q(x, y) primitively represents n, then is a square modulo n. Proof. a) Suppose n = Q(x, y) and e = gcd(x, y). Then e 2 n. b) Suppose there exist p, q Z with gcd(p, q) = 1 such that Q(p, q) = ( n. Then ) p q there exist integers r and s such that ps rq = 1. Then the matrix r s has determinant 1, so that the discriminant of the quadratic form Q (x, y) = Q(px + qy, rx + sy) is equal to. On the other hand, we compute Q (x, y) = Q(px + qy, rx + sy) = nx 2 + (2apr + bps + brq + 2cqs)xy + Q(r, s)y 2. Thus (1) = = (2apr + bps + brq + 2cqs) 2 4nQ(r, s), showing that is a square modulo n. Next we record some simple identities, which were already well-known to Euler. The modern (i.e., post Disquistiones Arithmeticae) take on them is as a special case of Gauss Composition, but that is not necessary to either discover or prove them. Indeed for the latter, direct calculation suffices, and is left to the reader. Proposition 4. Let D, A, B, x 1, x 2, y 1, y 2 Z. Then: ( x 2 1 + Dy1 2 ) ( x 2 2 + Dy2 2 ) = (x1 x 2 Dy 1 y 2 ) 2 + D (x 1 y 2 + x 2 y 1 ) 2, ( Ax 2 1 + By1 2 ) ( x 2 2 + ABy2 2 ) = A (x1 x 2 By 1 y 2 ) 2 + B (x 2 y 1 + Ax 1 y 2 ) 2, ( Ax 2 1 + By1 2 ) ( Ax 2 2 + By2 2 ) = (Ax1 x 2 By 1 y 2 ) 2 + AB (x 1 y 2 + x 2 y 1 ) 2. Corollary 5. For any 0 (mod 4), the set of integers represented by the principal form q is closed under multiplication. Theorem 6. Let q(x, y) = Ax 2 + Bxy + Cy 2 be a primitive anisotropic quadratic form of discriminant, and let p be an odd prime such that ( p ) = 1. a) Suppose that x, y Z are such that p q(x, y). Then p x and p y. b) It follows that for all (x, y) Z 2 \ {(0, 0)}, ord p (q(x, y)) is even.

4 PETE L. CLARK Proof. Step 0: Put P (t) = At 2 + Bt + C Z[t]. Since is not a square modulo p, a fortiori it is not a square in Z or equivalently, in Q so that p(t) Q[t] is an irreducible quadratic. Our assumption gcd(a, B, C) = 1 ensures that p(t) Z[t] is primitive, so by Gauss Lemma p(t) is an irreducible element of the UFD Z[t]. Hence it is also prime, so that R = Z[t]/(p(t)) is an integral domain. On the other hand, let α be the complex number B+ 2A. Then the homomorphism Z[t] Z[α] which sends t to α induces an isomorphism of rings R Z[α]. Step 1: Let p be an odd prime number such that ( p ) = 1. We claim that pr is a prime ideal; equivalently, we claim that the quotient ring R/pR = Z/pZ[t]/(At 2 + Bt + C) is an integral domain. But in turn this is equivalent to the (natural image in Z/pZ[t] of the) polynomial p(t) being irreducible in Z/pZ[t], which follows from our assumption that the discriminant is not a square in the field Z/pZ. By Step 0, we also have that pz[α] is a prime ideal of Z[α]. Step 2: Put α = B 2A. Note that Z[α] = Z[α]. For integers x and y, not both zero, we have in Z[α] a factorization q(x, y) = (x + αy)(x + αy). Therefore if p q(x, y), then since pz[α] is a prime ideal, we must have either p x + αy or p x + αy. Without loss of generality we consider the first case: we have that x p + y p α Z[α], i.e., there exist integers X and Y such that ( ) ( ) x y + α = X + Y α. p p Thus X = x p and Y = y p, so that p x and p y, establishing part a). Step 3: By Step 2, if p q(x, y), then x p, y p Z and thus ord p(q( x p, y p )) = 2 + ord p (q(x, y)). An evident induction finishes the proof. In light of Theorem 6, it is useful to give a name to odd prime numbers p bearing the property ( p ) = 1 with respect to a fixed discriminant. We call such primes anisotropic primes for. 3. The Main Theorem All of our work on representations of integers by binary quadratic forms is based on the following simple consequence of Thue s Lemma. Theorem 7. Let q(x, y) = Ax 2 + Bxy + Cy 2 Z[x, y] be an anisotropic quadratic form of discriminant = B 2 4AC. Let n Z + be a nonsquare such that gcd(n, 2C) = 1 and is a square modulo n. a) There exist k, y, z Z with 0 < x, y < n, 0 < k < A + B + C, such that q(x, y) = kn. b) If q is positive definite, then k > 0. c) If A > 0, B = 0, C < 0, then C < k < A. d) If AC < 0, then k < max( A + B, C + B ). Proof. Since n is odd, 1 2 Z/nZ and thus the quadratic formula is valid: since the discriminant of the quadratic Ax 2 + Bx + C is a square modulo n, there is a rational root: i.e., there exists c, l Z such that Ac 2 + Bc + C = ln. If a prime p divides c and n, it also divides C, contradicting our assumption; thus we must

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 5 have gcd(c, n) = 1. We may therefore apply Theorem 1 to n and c to get x, y Z, x cy (mod n) and 0 < x, y n. Since n is not a perfect square, we have x, y < n. We have on the one hand and on the other, q(x, y) = Ax 2 + Bxy + y 2 = y 2 (Ac 2 + Bc + C) 0 (mod n) 0 < q(x, y) Ax 2 + Bxy + Cy 2 < ( A + B + C )n, proving part a). b) If q is positive definite, then k = q(x,y) n > 0. c) Suppose q(x, y) = Ax 2 + Cy 2 with A > 0, C < 0. Then d) If AC < 0, then q(x, y) n C < q(x, y) n < A. B + Ax 2 + Cy 2 < B + max( A, C ) = max( A + B, C + B ). The following simple supplement to Theorem 7 will be useful. Proposition 8. Let n be a positive integer and D a squarefree integer. Suppose that Dn is of the form x 2 + Dy 2. Then also n is of the form x 2 + Dy 2. Proof. If x 2 + Dy 2 = Dn, then D x 2. Since D is squarefree, D x, so we may put x = DX with X Z. Then D 2 X 2 + Dy 2 = Dn, so n = y 2 + DX 2. 4. Some Elementary Applications In this section we give some especially simple applications of Theorem 7, of a sort that we feel would be suitable for a first undergraduate course in number theory in which quadratic reciprocity has been introduced. 4.1. Indefinite forms. Theorem 9. Let n be an odd integer such that 2 is a square modulo n. Then there exist integers x, y such that n = x 2 2y 2. Proof. Applying Theorem 7c), there exist integers x, y, not both zero, such that x 2 2y 2 = kp for 2 < k < 1. Thus k = 1, so that x 2 2y 2 = n. This is just the opposite of what we wanted to show, but take heart. The form q(x, y) = x 2 2y 2 is the principal form of discriminant 8, so that by Proposition 4 the set of nonzero integers it represents is closed under multiplication. Moreover, 1 2 2 1 2 = 1. Therefore Proposition 4 implies that q represents n iff it represents n, qed. Corollary 10. A nonzero integer is of the form q(x, y) = x 2 2y 2 iff for every prime p 3, 5 (mod 8), ord p (n) is even. Proof. By Proposition 4, the set of nonzero integers of the form x 2 2y 2 is closed under multiplication. It certainly includes all squares, 2 = 2 2 2 1 2, and by Theorem 9 all primes p ±1 (mod 8). Therefore the conditions given in the statement of the corollary are sufficient for n to be of the form x 2 2y 2. Conversely, the primes p 3, 5 (mod 8) are precisely those for which ( (q) p ) = ( 8 p ) = ( 2 p ) = 1 i.e., are anisotropic primes so by Theorem 6, it is necessary that ord p (n) be even at all such primes.

6 PETE L. CLARK Theorem 11. Let p > 3 be a prime number such that ( 3 p ) = 1. Then there exist integers x, y such that x 2 3y 2 = ( 1) p 1 2 p. Proof. Applying Theorem 7c), we get nonzero integers x, y, k with x 2 3y 2 = kp and 3 < k < 1, i.e., k = 2 or k = 1. Case 1: p 1 (mod 4). Together with ( 3 p ) = 1, this implies p 1 (mod 3). Reducing x 2 3y 2 = kp modulo 3 shows k 1 (mod 3), so k = 2. Thus 2p is of the form x 2 3y 2, which is not the answer that we want. But we can get there: 2 = 1 2 3 1 2 is also represented, so by Proposition 3 also ( 2p)( 2) = 4p is of the form x 2 3y 2. Reducing x 2 3y 2 = 4p modulo 4 shows that x and y are both even, so ( x 2 )2 3( y 2 )2 = p = ( 1) p 1 2 p. Case 2: p 3 (mod 4). Together with ( 3 p ) = 1, this implies p 2 (mod 3). Reducing x 2 3y 2 = kp modulo 3 shows k = 1, so x 2 3y 2 = p = ( 1) p 1 2 p. Corollary 12. Let n be a nonzero integer. a) Suppose that ord 3 (n) is even. Then n is of the form x 2 3y 2 iff both of the following hold: (i) For all odd primes p with ( 3 p ) = 1, ord p(n) is even; (ii) n is positive iff the number of prime divisors p of n such that 3 is a square modulo p and p 2 (mod 3), counted with multiplicity, is even. b) Suppose that ord 3 (n) is odd. Then n is of the form x 2 3y 2 iff both of the following hold: (i) For all odd primes p with ( 3 p ) = 1, ord p(n) is even; (ii) n is positive iff the number of prime divisors p of n such that 3 is a square modulo p and p 2 (mod 3), counted with multiplicity, is odd. Proof. Step 0: Suppose n = 3 a N with gcd(3, N) = 1 and x 2 3y 2 = 3 a N. Then 3 x so we may put x = 3X and substitute, getting 3X 2 y 2 = 3 a 1 N. If a > 1, then 3 y so we may put y = 3Y and substitute, getting X 2 3Y 2 = 3 a 2 N. Proceeding in this way, we see that if a is even, n = 3 a N is of the form x 2 3y 2 iff N is of that form, whereas if n is odd, n = 3 a N is of the form x 2 3y 2 iff N is of that form. Step 1: Taking Step 0 into account, it suffices to find necessary and sufficient conditions for an integer n with gcd(3, n) = 1 to be of the form x 2 3y 2. Since ) = 1, Theorem every square is of the form x 2 3y 2 and for every prime p with ( 3 p 11 shows that ±p is of the form x 2 3y 2, if n satisfies conditions (i) and (ii) in the statement of the corollary, then ±n = x 2 3y 2. Reducing modulo 3, we see that the sign is determined by the parity condition in (ii). Conversely, suppose n = x 2 3y 2. The primes p with ( 3 p ) = 1 are precisely those for which ( (q) p ) = 1 i.e., are anisotropic primes so by Theorem 6, it is necessary that ord p (n) be even at all such primes, so (i) is necessary. Again, reduction modulo 3 shows that (ii) is necessary. Example 1: Our method fails for the quadratic form x 2 5y 2. Suppose p is an odd prime with gcd(10, p) = 1. The congruence conditions imposed by x 2 5y 2 = p are simply ( 5 p ) = 1, i.e., p 1, 4 (mod 5). Applying Theorem 7c), if p 1, 4 (mod 5) then x 2 5y 2 = kp with 1 k 4. However, the case k = 4 is problematic: if in fact p is of the form x 2 5y 2, we certainly cannot rule out that 4p is also of this

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 7 form, because indeed 1 2 5 1 2 shows that 4 is of this form, and by Proposition 3 the set of integers represented by x 2 5y 2 is closed under multiplication. In other similar cases above, we were able to argue that a representation of 4K by a quadratic form q(x, y) implies that x and y are both even and thus that K = q( x 2, y 2 ) is also represented by the form. Indeed, for example 19 = 8 2 5 3 2. Since 4 = 1 2 5 1 2, by Proposition 3 we deduce the identity 4 19 = (23) 2 5 (11) 2. But this shows that x and y need not be even, so we cannot go backwards from a representation of 76 to a representation of 19. 4.2. Positive definite forms. If D = 1, then applying Theorem 7 immediately yields: Theorem 13. Let n be a positive integer such that 1 is a square modulo n. Then there exist integers x and y such that n = x 2 + y 2. Corollary 14. A positive integer n is of the form x 2 + y 2 iff for every prime p 3 (mod 4), ord p (n) is even. Proof. By quadratic reciprocity, for an odd prime p, ( 1 p ) = 1 if p 1 (mod 4) and ) = 1 if p 3 (mod 4). Therefore the conditions on the p-order at primes ( 1 p congruent to 3 modulo 4 are necessary by Theorem??b). Conversely, 2 = 1 2 + 1 2 and for any n, n 2 = n 2 + 0 2. Also, if p 1 (mod 4), then 1 is a square modulo p, so by Theorem 13, p is of the form x 2 + y 2. By Proposition 4a), if (2) n = 2 a p b1 1 pbr r q 2c1 1 qs 2cs, p 1,..., p r 1 (mod 4), q 1,..., q s 3 (mod 4), then n is of the form x 2 + y 2. Let D = 2. Applying Theorem 7 and Lemma 8 gives: Theorem 15. Let n be an odd positive integer such that 2 is a square modulo n. Then there exist integers x and y such that n = x 2 + 2y 2. Proof. We apply Theorem 7 with N = 2, getting that there exist integers x, y Z such that either x 2 + 2y 2 = n or x 2 + 2y 2 = 2n. In the former case we are done, so assume that x 2 + 2y 2 = 2n. Then 2 x, so we may write x = 2X and obtain 2n = x 2 + 2y 2 = 4X 2 + 2y 2, so n = y 2 + 2X 2. Corollary 16. A positive integer n is of the form x 2 + 2y 2 iff for every prime p 5, 7 (mod 8), ord p (n) is even. Proof. By quadratic reciprocity, for an odd prime p, ( 2 p ) = 1 if p 1, 3 (mod 8) and ( 2 p ) = 1 if p 5, 7 (mod 8). The remainder of the proof is very simmilar to that of Corollary 14. Details left to the reader. Remark: The common strategy of deduction of Corollary 14 (resp. Corollary 16) from Theorem 13 (resp. Theorem 15) persists in the proofs of Corollaries 18, 20 and 22. The proofs of these corollaries will therefore be omitted. Theorem 17. Let n be a positive integer such that gcd(12, n) = 1 and 3 is a square modulo n. Then there exist integers x and y such that n = x 2 + 3y 2.

8 PETE L. CLARK Proof. Applying Theorem 7 and Lemma 8, there exist integers x, y Z such that x 2 + 3y 2 = kn for some k, 1 k < 3. If k = 1, we re done, so we consider the case x 2 + 3y 2 = 2n. Reducing modulo 3 we get x 2 2n (mod 3). Let p be any (odd, by hypothesis) prime divisor of n. Then, since 3 is a square mod n, a fortiori we have ) = 1. By quadratic reciprocity, this implies p 1 (mod 3). That is, to say, n divisible only by primes of the form 1 (mod 3), from which it follows that n 1 (mod 3), and thus 2n 2 (mod 3). But then x 2 2 (mod 3), a contradiction. ( 3 p Corollary 18. A positive integer n is of the form x 2 + 3y 2 iff ord 2 (n) is even and for every prime p 1 (mod 3), ord p (n) is even. Proof. The method of proof of Corollaries 14 and 16 establishes this result for all odd n. It follows by Proposition 5 that the given conditions are sufficient for representability of n. Now suppose that n = 2 a m with m and a both odd. We must show that n is not of the form x 2 + 3y 2. Case 1: a = 1. Then reducing x 2 + 3y 2 = 2m modulo 4 gives a contradiction. So we may assume a 3 and, seeking a contradiction, that we have integers x and y such that x 2 + 3y 2 = 2 a m. Case 2: x and y are both odd. Then reducing modulo 8 gives a contradiction. Case 3: x and y have opposite parity. Then reducing modulo 2 gives a contradiction. Case 4: x = 2X, y = 2Y. Then X 2 + 3Y 2 = 2 a 2 m and an inductive argument completes the proof. Theorem 19. Let n be an odd positive integer such that 4 is a square modulo n. Then there exist integers x and y such that n = x 2 + 4y 2. Proof. Writing x 2 + 4y 2 as x 2 + (2y) 2, the result becomes equivalent to the claim that in the conclusion of Theorem 13, we can take one of x or y to be even. This is certainly true, because if they were both odd, then x 2 + y 2 = n would be even. Corollary 20. A positive integer n is of the form x 2 + 4y 2 iff ord 2 (n) 1 and for every prime p 1 (mod 4), ord p (n) is even. Proof. Again the arguments for odd n are similar to those given above. If ord 2 (n) = 1, then reducing modulo 4 shows that n is not of the form x 2 + 4y 2. On the other hand, 4 = 2 2 + 4 0 2 and 8 = 2 2 + 4 1 2 are both of the form x 2 + 4y 2, hence so is every n = 2 k with k > 1. The result follows. Theorem 21. Let n be a positive integer such that gcd(14, n) = 1 and 7 is a square modulo n. Then there exist integers x and y such that n = x 2 + 7y 2. ) = 1, so by quadratic reciprocity p is a square modulo 7. Therefore n is a product of nonzero squares modulo 7 so it itself a nonzero square modulo 7. Therefore k, being the quotient of nonzero squares modulo 7, is itself a nonzero square modulo 7: i.e., k = 1, 2, 4. Step 2: Suppose x 2 + 7y 2 = 2n. The possible values of the left hand side modulo 8 are 0, 1, 3, 4, 5, 7. The possible values of the right hand side are 2, 6: contradiction. Step 3: Suppose x 2 +7y 2 = 4n. Since the right hand side is even, x and y must have Proof. Applying Theorem 7 and Lemma 8, there exist integers x, y Z such that x 2 + 7y 2 = kn for some k, 1 k < 7. If k = 1 we are done, so assume k > 1. Step 1: Reducing modulo 7, we get x 2 kn (mod 7), i.e., kn is a nonzero square modulo 7. Let p be any (odd, by hypothesis) prime divisor of n. Then our hypothesis implies ( 7 p

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 9 the same parity. If they are both odd, x 2 + 7y 2 0 (mod 8), contradiction. So x and y are both even: x = 2X, y = 2Y, 4X 2 + 4 7Y 2 = 4p, and X 2 + 7Y 2 = p. Corollary 22. A positive integer is of the form x 2 + 7y 2 iff ord 2 (n) 1 and for every prime p 3, 5, 6 (mod 7), ord p (n) is even. Proof. By quadratic reciprocity, for an odd prime p, ( 7 p ) = 1 if p 1, 2, 4 (mod 7) and ( 7 p ) = 1 if p 3, 5, 6 (mod 7). The rest is left to the reader. 4.3. Comparison with the approach via unique factorization. By way of comparison, I wish to outline the approach I have heretofore used in undergraduate number theory courses at the University of Georgia. Let D 0, 1 be a squarefree integer. We wish to examine which prime numbers p are of the form x 2 + Dy 2. For this we introduce the quadratic ring Z[ D] = Z[t]/(t 2 D), an integral domain. Theorem 23. Suppose that the ring R = Z[ D] is a unique factorization domain (UFD). For a prime number p, consider the following two conditions: (p1) D is a square modulo p. (p2) There exist x, y Z such that p = x 2 Dy 2. Then (p1) = (p2) always, and (p2) = (p1) if gcd(p, D) = 1. Proof. Suppose that gcd(p, D) = 1 and that x 2 Dy 2 = ±p. Reducing modulo p gives x 2 Dy 2 (mod p). If p x, then since gcd(p, D) = 1, p y and thus p 2 x 2 Dy 2 = ±p, a contradiction. Therefore D ( x y )2 (mod p). Now suppose that D is a square modulo p, i.e., there exists n Z such that pn = x 2 D = (x + D)(x D). Case 1: Suppose p is a prime element in R. Then, since p (x + D)(x D), we have p x ± D, i.e., x p ± 1 p D = X + Y D with X, Y Z. But 1 p Z. Case 2: Since Z[ D] is a UFD, it follows that the element p must be reducible in Z[ D]: i.e., there exist nonunit elements α, β Z[ D] such that (3) p = αβ. Now recall that we have a norm N : R Z, a + b D a 2 Db 2 which has the following (easily verified) properties: For α R, N(α) = 1 iff α is a unit in R. For α, β R, N(αβ) = N(α)N(β). Thus, taking norms in (3) gives p 2 = N(α)N(β), and since α and β are not units we must have p = N(α) = N(β). Putting α = x + y D, we get p = N(α) = x 2 Dy 2. Of course the usefulness of Theorem 23 depends on how frequently the rings Z[ D] are UFDs and how easily this can be shown. The easy cases are as follows: Proposition 24. For D = 2, 1, 2, 3, Z[ D] is Euclidean with respect to the norm map and is therefore a UFD.

10 PETE L. CLARK Proof. See e.g. [HW6ed, Thm. 246]. Taking D = 1 and 2 we recover Theorems 13 and 15. When D = 2 and D = 3 we get results of the form p = ±(x 2 Dy 2 ) and the resolution of the sign issues can be decided as in the proofs above: in case D = 2, since 1 is of the form x 2 Dy 2, both signs occur; in case D = 3 reduction modulo 4 determines the sign. What about other values of D? In fact, when D is positive, there are many values of D for which Z[ D] is a UFD. Indeed, Gauss conjectured that there are infinitely many such D. This remains open to this day (and is arguably the single most notorious open problem in basic algebraic number theory) although it is extremely well supported by both computational evidence and probabilistic heuristics. However, the values of D > 3 such that Z[ D] is Euclidean with respect to the above norm are D = 6, 7, 11, 19 [HW6ed, Thm. 247]. For the many other values of D for which Z[ D] is a UFD, so far as I know showing this requires somewhat deeper tools coming from either quadratic form theory or algebraic number theory. The case of negative D is quite different. Corollary 25. For no squarefree D < 2 is Z[ D] a UFD. Proof. Indeed, condition (p2) of Theorem 23 holds D is certainly a square modulo 2 but condition (p1) does not: 2 is not of the form x 2 + D y 2. Thus Theorems 17 and 21 lie outside the scope of Theorem 23. A more advanced take on the matter is as follows: the rings Z[ 3] and Z[ 7] fail to be UFDs for a rather superficial reason: they are not integrally closed in their fraction fields. Suppose we replace these non-maximal orders with the full rings of integers in their fraction fields namely Z[ 1+ 3 2 ] and Z[ 1+ 7 2 ]. Then these new domains are Euclidean with respect to the above norm and thus UFDs. A version of Theorem 23 holds here, which allows us to classify primes of the form x 2 +xy+y 2 and x 2 +xy+2y 2 (note that these are the principal forms of discriminants 3 and 7). Just as in Theorem 19 representations by x 2 + 4y 2 amount to representations by x 2 + y 2 with extra parity conditions, one can analyze primes of the form x 2 +3y 2 (resp. x 2 +7y 2 ) in terms of primes of the form x 2 + xy + y 2 (resp. x 2 + xy + 2y 2 ) with extra parity conditions. However, these arguments seem too messy and unmotivated for most undergraduates, and I have never covered them in an undergraduate number theory course (but rather at the beginning of an intermediate level graduate course based on Cox s book [Cox]). In contrast, I think the given proofs of Theorems 17 and 21 would go over well at the undergraduate level, and I intend to incorporate them into future courses. 5. Representation of Primes By Squarefree Idoneal Forms 5.1. Auxiliary Congruence Conditions and Small Examples. The reader may have wondered why, in 4.2, the values D = 5 and D = 6 were skipped. The answer is that, for these values, the converse of Proposition 3 is false: the necessary condition ( D p ) = 1 is no longer sufficient for a prime p to be of the form x 2 + Dy 2. Example 2: take D = 5 and p = 3. Then ( 5 3 ) = 1, but the equation 3 = x2 + 5y 2

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 11 has no solutions. Example 3: Take D = 6 and p = 5. Then ( 6 5 ) = 1, but the Diophantine equation 5 = x 2 + 6y 2 has no solutions. The reasons for this are not so mysterious: for these values of D as well as infinitely many others there are auxiliary congruence conditions to take into account. Indeed we have the following results, the proofs of which are immediate. Proposition 26. (Auxiliary Congruence Conditions) Let D Z +, and let p be a prime number with gcd(p, 2D) = 1. Suppose that there exist x, y Z such that x 2 + Dy 2 = p. Then: a) For each odd prime l dividing D, ( p l ) = 1. b) If D 1 (mod 4), then p 1 (mod 4). c) If D 2 (mod 8), then p 1, 3 (mod 8). d) If D 6 (mod 8), then p 1, 7 (mod 8). Lemma 27. Suppose A, B, x, y Z are such that 4n = Ax 2 + By 2. moreover that one of the following holds: (i) A is odd and B 2 (mod 4) (or conversely). (ii) A and B are both odd and A B (mod 4). Then x and y are both even, hence n = A( x 2 )2 + B( y 2 )2. Suppose Remarkably, simply by taking these auxiliary congruence conditions into account, the above methods can be extended to derive results for these values of D. Theorem 28. Let p be a prime number with gcd(10, p) = 1. Suppose that p 1 (mod 4) and ( 5 p ) = 1. Then there exist x, y Z such that p = x2 + 5y 2. Proof. Applying Theorem 7 and Lemma 8, there exist integers x, y Z such that x 2 + 5y 2 = kp for some k, 1 k < 5. Reducing modulo 5, we get x 2 kp (mod 5), i.e., kp is a nonzero square modulo 5. Our hypotheses imply that p is a square modulo 5, and hence so is k: i.e., k = 1 or k = 4. If x 2 + 5y 2 = 4p, then by Lemma 27, x and y are even, so p = ( x 2 )2 + 5( y 2 )2. Theorem 29. A prime p is of the form x 2 +6y 2 iff ( 6 p ) = 1 and p ±1 (mod 8). Proof. Evidently x 2 + 6y 2 represents no non-squares less than 6, no 2 and 5 are not represented: we may assume gcd(p, 10) = 1. Then the given conditions are necessary by Proposition 26. Conversely, assume they are satisfied. Applying Theorem 7 and Lemma 8, there exist integers x, y Z such that x 2 + 6y 2 = kp for some k, 1 k < 6. Reducing modulo 3, we get x 2 kp (mod 3), so that kp 0, 1 (mod 3). Our hypotheses imply p 1 (mod 3). It follows that k = 1, 3, 4. By Lemma 27, if 4p is of the form x 2 + 6y 2, so is p. It remains to consider the case k = 3, i.e., x 2 + 6y = 3p. We may write x = 3X and subsitute, getting 3x 2 + 2y 2 = p. Certainly 3 is not of the form x 2 + 6y 2, so we may assume p > 3. Reducing modulo 3 then gives p 2y 2 2 (mod 3), a contradiction. Theorem 30. An odd positive integer n is of the form x 2 + 8y 2 iff: (i) For all primes p 5, 7 (mod 8), ord p (n) is even, and (ii) n 1 (mod 4).

12 PETE L. CLARK Proof. Since x 2 + 8y 2 = x 2 + 2(2y) 2, a positive integer is of the form x 2 + 8y 2 iff it is of the form x 2 + 2y 2 with y even. By Corollary 16, for n prime to 2, n is of the form x 2 + 8y 2 iff for every prime divisor p of n with p 5, 7 (mod 8), ord p (n) is even. Thus condition (i) is necessary. Moreover, reducing x 2 + 8y 2 = n modulo 4 gives n x 2 (mod 4); since n is odd, we conclude n 1 (mod 4): condition (ii). Conversely, suppose n satisfies (i) and (ii), so by Corollary 16 we may write n = x 2 + 2y 2. If y is odd, then n x 2 + 2 2, 3 (mod 4), hence we must have y is even, qed. Theorem 31. A positive integer n prime to 6 is of the form x 2 + 9y 2 iff: (i) For all primes p 3 (mod 4), ord p (n) is even, and (ii) n 1 (mod 3). Proof. Since x 2 + 9y 2 = x 2 + (3y) 2, an integer n is of the form x 2 + 9y 2 iff it is of the form x 2 + y 2 with at least one of x, y divisible by 3. Thus by Corollary 14, condition (i) is necessary. Conversely, reducing n = x 2 + 9y 2 modulo 3 gives n x 2 1 (mod 3): condition (ii). Conversely, suppose n satisifes (i) and (ii), so by Corollary 14 we may write n = x 2 + y 2. If 3 xy, then n x 2 + y 2 2 (mod 3), hence we must have 3 x or 3 y, qed. Theorem 32. A prime number p is of the form x 2 +10y 2 iff ( 10 p ) = 1 and ( p 5 ) = 1. Proof. As above, we may assume that p > 5 and thus gcd(10, p) = 1, and then Proposition 26 shows the conditions to be necessary. Conversely, assume they are satisfied. Applying Theorem 7 and Lemma 8, there exist integers x, y Z such that x 2 + 10y 2 = kp for some k, 1 k < 10. Step 1: Suppose first that gcd(k, 5) = 1, or equivalently under our hypotheses, k 5. Reduction modulo 5 shows that ( k 5 ) = 1, i.e., k = 1, 4, 6, 9. Moreover ( 10 3 ) = 1, i.e., 3 is an anisotropic prime. Therefore, if x2 + 10y 2 = 6p, then 3 p, contradiction; and if x 2 + 10y 2 = 9p, then x and y are both divisible by 3 and thus ( x 3 )2 + 10( y 3 )2 = p. Step 2: Suppose that x 2 + 10y 2 = 5p. Then 5 x, so we may write x = 5X and substitute, getting 5x 2 + 2y 2 = p. Reducing this equation modulo 5 gives a contradiction. 5.2. The representation theorem. Example 4: Consider the quadratic form q(x, y) = x 2 + 11y 2. In this case, the congruence conditions ( 11 p ) = 1 togther with the auxiliary congruence conditions of Proposition 26 are not sufficient for a prime p to be of the form x 2 +11y 2. Indeed, take p = 353; it is congruent to 1 modulo 44, so satisfies all congruence conditions, but is easily seen not to be of the given form. In fact, with a bit more work it can be shown that the congruence x 2 + 11y 2 353 (mod n) has solutions for every n Z +. That is, the set of primes represented by x 2 + 11y 2 is not characterized by any set of congruence conditions whatsoever. In fact, the following is true. Theorem 33. For a positive integer D, the following are equivalent: (i) There exist coprime positive integers a and N such that every prime number p a (mod N) is of the form x 2 + Dy 2. (ii) Every prime number p 1 (mod 4D) is of the form x 2 + Dy 2.

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 13 (iii) There is a nonempty subset S (Z/4DZ) such that for a prime number p with gcd(p, D) = 1, p is of the form x 2 + Dy 2 iff p s (mod 4D) for some s S. (iv) D = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 15, 16, 18, 21, 22, 24, 25, 28, 30, 33, 37, 40, 42, 45, 48, 57, 58, 60, 70, 72, 78, 85, 88, 93, 102, 105, 112, 120, 130, 133, 165, 168, 177, 190, 210, 232, 240, 253, 273, 280, 312, 330, 345, 357, 385, 408, 462, 520, 760, 840, 1320, 1365, 1848, plus at most two further values of D. Any further values of D which exist are at least 10 8. A positive integer D satisfying the above equivalent conditions is said to be idoneal. Proof. This is a classical, but not easy, result. The most accessible reference for the nonspecialist is probably [Cox]. In other words, we need only try out our elementary methods on idoneal numbers D. Conversely, we will now show that (at least) for all squarefree idoneal numbers D appearing on the above list, our elementary methods succeed in determining all primes represented by x 2 + Dy 2. Theorem 34. Let D be one of the following integers: 1, 2, 3, 5, 6, 7, 10, 13, 15, 21, 22, 30, 33, 37, 42, 57, 58, 70, 78, 85, 93, 102, 105, 130, 133, 165, 177, 190, 210, 254, 273, 330, 345, 357, 385, 462, 1365. Then a prime p is of the form x 2 + Dy 2 iff p = D or all of the following hold: (i) ( D p ) = 1, (ii) For all odd primes l D, ( p l ) = 1, (iii) If D 1 (mod 4), then p 1 (mod 4). (iv) If D 2 (mod 8), then p 1, 3 (mod 8). (v) If D 6 (mod 8), then p 1, 7 (mod 8). 5.3. Proof of the Representation Theorem: D an odd prime. Theorem 35. A prime number p 13 is of the form q(x, y) = x 2 + 13y 2 iff p 1 (mod 4) and ( p 13 ) = 1. Proof. The necessity has been established in Proposition 26. Conversely, assume the conditions; by Theorem 7 and Lemma 8, there exist positive integers x, y, k with x 2 + 13y 2 = kp and 1 k < 13. Reducing modulo 13 gives the condition ( k 13 ) = 1, which leaves us with the following values of k: 1, 3, 4, 9, 10, 12. The case k = 1 is the desired one, and the case k = 4 reduces to k = 1 by Lemma 27. The remaining values of k are all divisible by either 3 or 5; but ( 52 3 ) = ( 52 5 ) = 1, so 3 and 5 are both anisotropic primes for q. When ord 3 (k) or ord 5 (k) = 1, this contradicts Theorem 6; when ord 3 (k) = 2, this allows us to reduce to the case k 9 = 1. The proof for the remaining prime idoneal number, D = 37, follows similar lines. Theorem 36. A prime number p 37 is of the form q(x, y) = x 2 + 37y 2 iff p 1 (mod 4) and ( p 37 ) = 1. Proof. Cutting to the chase, if p satisfies the above conditions, there are positive integers x, y, k with x 2 + 37y 2 = kp and 1 k < 37. Reducing modulo 37 gives the condition ( k 37 ) = 1; the values of k meeting this condition, in factored form, are k = 3, 2 2, 7, 3 2, 2 5, 11, 2 2 3, 2 4, 3 7, 5 2, 2 13, 3 3, 2 2 7, 2 3 5, 3 11, 2 17, 2 2 3 2.

14 PETE L. CLARK Arguing as in the proof of Theorem 35 above, we may remove from consideration any k which is divisible by an anisotropic prime for q, i.e., an odd prime l with ) = 1. Direct computation shows that the primes ( 104 l l = 3, 5, 7, 11, 17 are all anisotropic for (q) = 104. We are left with k of the form 2 2a, which are reduced to k = 1 by a applications of Lemma 27. 5.4. Proof of the Representation Theorem: D twice an odd prime. Theorem 37. Let p be a prime number. Then p is of the form x 2 +22y 2 iff p ±1 (mod 8) and ( p 11 ) = 1. Proof. Cutting to the chase, if p satisfies the above conditions, there are positive integers x, y, k with x 2 + 22y 2 = kp and 1 k < 22. Case 1: We assume that gcd(k, 11) = 1. Then reducing modulo 11 gives the condition ( k 11 ) = 1; the values of k meeting this condition, in factored form, are k = 1, 3, 2 2, 5, 3 2, 2 2 3, 2 7, 3 5, 2 4, 2 2 5. As above, we may remove from consideration any k which is divisible by an anisotropic prime for q, i.e., an odd prime l with ( 104 l ) = 1. Direct computation shows that the primes l = 3, 5, 7 are all anisotropic for (q) = 88. We are left with k of the form 2 2a, which are reduced to k = 1 as above. Case 2: We assume that k = 11, so x 2 + 22y 2 = 11p. Thus 11 x and we may write x = 11X and substitute, getting 11X 2 + 2y 2 = p. Reducing modulo 11 gives a contradiction. Theorem 38. Let p be a prime number. Then p is of the form x 2 + 58y 2 iff p ±1, 3 (mod 8) and ( p 29 ) = 1. Proof. If p satisfies the above conditions, there exist integers x, y, k, with 1 k 57, such that x 2 + 58y 2 = kp. Case 1: We assume that gcd(k, 29) = 1. Then reducing modulo 29 gives the condition ( k 29 ) = 1; the values of k meeting this condition, in factored form, are k = 1, 2 2, 5, 2 3, 7, 3 2, 13, 2 4, 2 2 5, 2 11, 23, 2 3 3, 5 2, 2 2 7, 2 3 5, 3 11, 2 17, 5 7, 2 2 3 2, 2 19, 2 3 7, 3 2 5, 7 2, 3 17, 2 2 13, 53, 2 3 3, 3 19. Computation shows that the primes l = 3, 5, 7, 13, 17, 19, 23, 53 are all anisotropic for (q) = 232. As above, we may remove from consdieration any k which is divisible by an anisotropic prime or an even power of 2, eliminating every value except k = 1. Case 2: We assume that k = 29, so x 2 + 58y 2 = 29p. Thus 29 x and we may write x = 29X and substitute, getting 29X 2 + 2y 2 = p. Reducing modulo 29 gives a contradiction.

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 15 5.5. Proof of the Representation Theorem: D a product of two odd primes. The values of D in question are 15, 21, 33, 57, 85, 93, 133, 177, 253. Rather than giving the argument for all of these values, we will illustrate with the smallest and largest values, D = 3 5 and D = 11 23. Theorem 39. Let p be a prime number with gcd(30, n) = 1 and ( 15 p ) = 1. a) Suppose that ( p 3 ) = ( p 5 ) = 1. Then there exist x, y Z such that p = x2 + 15y 2. b) Suppose that ( p 3 ) = ( p 5 ) = 1. Then there exist x, y Z such that p = 3x2 + 5y 2. c) Suppose that n is squarefree and prime to 30, say n = p 1 p r. Then n is of the form x 2 + 15y 2 iff: (i) for every prime p dividing n, ( 15 p ) = 1 and (ii) the number of primes p 2 (mod 3) dividing n is even. Proof. a) There exists an integer k, with 1 k 14, such that kp is of the form x 2 + 15y 2. Case 1: Assume that gcd(k, 15) = 1. Then reducing modulo 3 and 5 gives k 1 (mod 3) and k ±1 (mod 5), so k = 1 or 4. If k = 1, we re done. If x 2 +15y 2 = 4p, then reducing modulo 8 shows that x and y are both even, so ( x 2 )2 + 15( y )2 = p. Case 2: Assume that 3 k and put k = 3K with 1 K 4. If x 2 + 15y 2 = 3Kp, then we may put 3 = 3X and get an equation 3X 2 + 5y 2 = Kp. Reducing modulo 5 rules out K = 1, 4. If K = 2, then reducing modulo 4 gives a contradiction. If K = 3, then we may write X = 3X and get the equation X 2 + 15y 2 = p, great. Case 3: Assume 5 k and put k = 5K with 1 K 2. From x 2 + 15y 2 = 5Kp, we may write x = 5X, getting 5x 2 + 3y 2 = Kp, reducing us to Case 2. b) There exists an integer k, with 1 k 7, such that kp is of the form 3x 2 + ) = 1, eliminating k = 2, 3, 7. If 5y 2 = kp. Reducing modulo 5 shows that ( k 5 3x 2 + 5y 2 = 4p, reducing modulo 8 gives a contradiction. If 3x 2 + 5y 2 = 5p, then we get 15x 2 + y 2 = p and reducing either modulo 3 or 5 gives a contradiction. Finally, if 3x 2 + 5y 2 = 6p, then we are reduced to 15x 2 + y 2 = 2p and we obtain a contradiction by reducing modulo 4. c) Since n is squarefree, by Proposition 3, in order for n to be represented by either x 2 + 15y 2 or 3x 2 + 5y 2 we need 15 to be a square modulo n and thus a square modulo each prime divisor of n. Moreover, the second condition is equivalent to n 1 (mod 3), which is certainly necessary, as one can see by reducing modulo 3. Conversely, if these two conditions are satisfied, we may write n = n 1 (p 1 p 2 ) (p 2s 1 p 2s ), where n 1 is the product of all prime divisors of n congruent to 1 mod 3. By Proposition 4, n 1 and each of p 1 p 2, p 3 p 4,..., p 2s 1 p 2s are of the form x 2 + 15y 2. Applying Proposition 4 again, so is their product. Theorem 40. A prime p is of the form q(x, y) = x 2 + 253y 2 iff p 1 (mod 4) and ( p 11 ) = ( p 23 ) = 1. Proof. Note that 253 = 11 23, and we may certainly assume p > 23. If p satisfies these conditions, there exist x, y, k Z with 1 k 252, such that x 2 +253y 2 = kp. Case 1: We assume that gcd(k, 11 23) = 1. Then reducing modulo 11 and 23 gives the conditions ( k 11 ) = ( k 23 ) = 1. The values of k meeting these conditions, in factored form, are k = 1, 3, 2 2, 3 2, 2 2 3, 2 4, 5 2, 2 13, 3 3, 31, 2 2 3 2, 47, 2 4 3, 7 2, 2 29, 59, 2 6, 2 5 7, 71, 3 5 2, 2 3 13, 3 4, 2 41, 3 31, 2 2 5 2, 2 3 13, 2 2 3 3, 7 17, 2 2 31

16 PETE L. CLARK 7 19, 3 47, 2 4 3 2, 2 73, 3 7 2, 163, 13 2, 2 5 17 2 3 29, 3 59, 19, 5 37, 2 2 47, 2 5 19, 2 6 3, 2 2 7 2 2 101, 2 3 5 7, 3 71, 223, 3 2 5 2, 2 3 29, 2 3 2 13, 2 2 59, 3 5, 2 3 41. Since the primes l = 3, 5, 7, 13, 19, 29, 37, 41, 47, 71, 73, 101, 163, 179, 223 are all anisotropic for (q) = 1012, these values may be eliminated, together with, by Lemma 27, any value of k which is divisible by 4. We are left with k = 1. Case 2: Suppose that 11 k and gcd(k, 23) = 1. Then we may write k = 11K, getting x 2 +(11 23)y 2 = 11Kp. Thus 11 x, so put x = 11X and substitute, getting 11X 2 + 23y 2 = Kp, with 1 K 22. We may assume that gcd(11, K) = 1, otherwise we change variables again, getting an equation of the form X 2 + (11 23Y 2 ) = k 11 p: i.e., we are reduced to a smaller value of k. Now reducing modulo 2 11 and modulo 23 gives us the conditions K Kp 23 = = = 1, 11 11 11 K Kp 11 = = = 1. 23 23 23 The values of K meeting these conditions, in factored form, are K = 5, 2 7, 3 5, 2 2 5. The quadratic form q 2 (x, y) = 11x 2 + 23y 2 has the same discriminant as q 1, hence the same anisotropic primes, including 3,5 and 7. Case 3: Suppose that gcd(11, k) = 1 and 23 k. As above, we may write k = 23K with gcd(k, 11 23) = 1 and 1 K < 11, getting x 2 + (11 23)y 2 = 11Kp. So we may write x = 23X and substitute, getting 23X 2 + 11y 2 = kp. But up to the (harmless) interchange of the two variables, this is the same as Case 2 except with a smaller value of K! Therefore, we need not consider it. Case 4: Suppose that k is divisible by both 11 and 23. Thus k = 11 23. In fact this is ruled out by Lemma 8, but is helpful for other values of D to consider it anyway: we would have x = (11 23)X and thus 253X 2 + y 2 = p, i.e., we would be done. The proofs for D = l 1 l 2 = 15, 21, 33, 57, 85, 93, 133, 177 all follow the same format. In the first case, we assume that k is prime to D and check that every value of k meeting the conditions ( k l 1 ) = ( k l 2 ) = 1 is divisible by either 2 2 or by at least one odd prime p such that ( D p ) = 1. In the second case, we assume that k is exactly divisible by l 1 the smaller of the two primes and not divisible by l 2, and then we get transferred to the equation l 1 x 2 + l 2 y 2 = Kp with 1 K < l 2. Reduction modulo l 1 and l 2 gives us the congruence conditions ( K l 1 ) = ( l2 l 1 ) and ( K l 2 ) = ( l2 l 1 ), and we check that every value of K meeting these conditions is divisible by at least one anisotropic prime. As above, one might

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 17 initially think that there are Cases 3 and 4, but in fact we soon see that consideration of these cases is not necessary. 5.6. Proof of the Representation Theorem: remaining values of D. The proofs follow the same outline as above: if D is divisible by a distinct primes, then there will be 2 a 1 cases: there are 2 a different diagonal forms of discriminant 4D, but the forms ax 2 + D a y2 and D a x2 + ay 2 need not be considered separately. We illustrate with two values in which four cases are required and one value in which eight cases are required. Theorem 41. A prime p is of the form x 2 + 190y 2 iff p ±1 (mod 8) and ( p 5 ) = ( p 19 ) = 1. Proof. Note that 190 = 2 5 19. We may assume p > 19. If p satisfies these conditions, there exist x, y, k Zwith 1 k 189, such that x 2 + 190y 2 = kp. Case 1: We assume that gcd(k, 5 19) = 1. Then reducing modulo 5 and 19 gives the conditions ( k 5 ) = ( k 9 ) = 1. The values of k meeting these conditions, in factored form, are k = 1, 2 2, 2 3, 3 2, 11, 2 4, 2 3 3, 2 13, 2 2 3 2, 3 13, 2 2 11, 7 2, 2 3 3, 61, 2 6, 2 3 11, 2 37, 2 5 3, 3 2 11, 101, 2 3 13, 2 53, 3 37, 7 17, 11 2, 131, 2 67, 139, 2 4 3 2, 149, 2 2 3 13, 3 53, 7 23, 13 2, 2 4 11. Since the primes l = 3, 7, 11, 13, 17, 23, 37, 53, 61, 67, 101, 131, 139, 149 are all anisotropic for (q) = 1960, these values may be eliminated, together with, by Lemma 27, any value of k which is divisible by 4. We are left with k = 1. Case 2: Suppose that 5 k and gcd(k, 19) = 1. Then we may write k = 5K, getting x 2 + (2 5 19)y 2 = 5Kp. Thus 5 x, so put x = 5X and substitute, getting 5X 2 + 2 19y 2 = Kp, with 1 K 38. As above, we may assume that gcd(5, K) = 1. Now reducing modulo 5 and modulo 19 gives us the conditions K Kp 2 19 5 5 5 K Kp 5 = = = 1. 19 19 19 The values of K meeting these conditions, in factored form, are K = 7, 17, 23, 2 2 7. The quadratic form q 2 (x, y) = 5x 2 + 2 19y 2 has the same discriminant as q 1, hence the same anisotropic primes, including 7, 17 and 23. Case 3: Suppose that 19 k and gcd(k, 5) = 1. Then we may write k = 19K, getting x 2 + (2 5 19)y 2 = 19Kp. Thus 19 x, so put x = 19X and substitute, getting 19X 2 + 2 5y 2 = Kp, with 1 K 10. In particular gcd(k, 19) = 1. Reducing modulo 5 and modulo 19 gives us the conditions K Kp 19 = = = 1, ( K 19 5 ) = ( Kp 19 5 ) = ( 10 19 5 ) = 1.

18 PETE L. CLARK There are no values of K in our range meeting these conditions. Case 4: k = 5 19, i.e., x 2 +(2 5 19)y 2 = (5 19)p. Thus we may write x = (5 19)X and substitute, getting (5 19)X 2 + 2y 2 = p. Redcuing modulo 5 gives ( p 5 ) = ( 2 5 ), a contradiction. Theorem 42. A prime p is of the form x 2 + 385y 2 iff p 1 (mod 4) and ( p 5 ) = ( p 7 ) = ( p 11 ) = 1. Proof. Note that 385 = 5 7 11. We may assume p > 11. If p satisfies these conditions, there exist x, y, k Z with 1 k 384, such that x 2 + 385y 2 = kp. Case 1: We assume that gcd(k, 5 7 11) = 1. Then reducing modulo 5, 7 and 11 gives the conditions ( k 5 ) = ( k 7 ) = ( k 11 ) = 1. The values of k meeting these conditions, in factored form, are k = 1, 2 2, 3 2, 2 4, 2 2 3 2, 2 6, 71, 3 4, 2 43, 2 3 19, 3 47, 2 4 3 2, 13 2, 179, 191, 2 107, 13 17, 2 3 41, 2 127, 2 8, 2 2 71, 17 2, 3 97, 3 103, 2 2 3 4, 331, 2 3 43, 19 2, 2 3 61, 379. Since the primes l = 3, 13, 17, 19, 43, 47, 71, 103, 107, 127, 179, 191, 331, 379 are all anisotropic for (q) = 1540, these values may be eliminated, together with, by Lemma 27, any value of k which is divisible by 4. We are left with k = 1. Case 2: Suppose that 5 k and gcd(7 11, k) = 1. Substituting x = 5X as usual, we descend to the form q 2 (x, y) = 5x 2 + (7 11)y 2 = Kp, with 1 K < 77. As above, we may assume that gcd(5, K) = 1. Reducing modulo 5, 7 and 11 gives us the conditions K Kp 77 5 5 5 K Kp 5 7 7 7 K Kp 5 = = = 1. 11 11 11 The values of K meeting these conditions, in factored form, are K = 3, 2 2 3, 3 2, 2 19, 47, 2 4 3. Each such K is divisible by an anistropic prime for (q 2 ) = (q). Case 3: Suppose that 7 k and gcd(5 11, k) = 1. Substituting x = 7X as usual, we descend to the form q 3 (x, y) = 7x 2 + (5 11)y 2 = Kp, with 1 K < 55. As above, we may assume that gcd(7, K) = 1. Reducing modulo 5, 7 and 11 gives us the conditions K Kp 7 5 5 5 K Kp 55 7 7 7 K Kp 7 = = = 1. 11 11 11 The values of K meeting these conditions, in factored form, are K = 13, 17, 2 2 13,

THUE S LEMMA AND IDONEAL QUADRATIC FORMS 19 and once again 13 and 17 are anisotropic primes for (q 3 ) = (q). Case 4: Suppose that 11 K and gcd(5 7, k) = 1. Substituting x = 11X as usual, we descend to the form q 4 (x, y) = 11x 2 + (5 7)y 2 = Kp with 1 K < 35. As above, we may assume that gcd(11, K) = 1. Reducing modulo 5, 7 and 11 gives us the conditions K Kp 11 = = = 1, 5 5 5 K Kp 11 = = = 1, 7 7 7 K Kp 35 = = = 1. 11 11 11 The only value of K which meets these conditions is K = 29, which is anisotropic for (q 4 ) = (q). Theorem 43. A prime p is of the form q(x, y) = x 2 + 1365y 2 iff p 1 (mod 4) and ( p 3 ) = ( p 5 ) = ( p 7 ) = ( p 13 ) = 1. Proof. Note that 1365 = 3 5 7 13. We may assume p > 13. If p satisfies these conditions, there exist x, y, k Z with 1 k 1364, such that x 2 + 1365y 2 = kp. Case 1: We assume that gcd(k, 3 5 7 13) = 1. Then reducing modulo 3, 5, 7and 13 gives the conditions ( k 3 ) = ( k 5 ) = ( k 7 )( k 13 ) = 1. The values of k meeting these conditions, in factored form, are k = 1, 2 2, 2 5, 2 6, 79, 11 2, 211, 2 6, 2 137, 17 2, 2 2 79, 19 2, 2 197, 2 2 11 2, 23 2, 571, 19 31, 2 317, 2 17 19, 751, 11 71, 29 2, 2 2 211, 919, 2 11 43, 31 2, 991, 2 10, 2 17 31, 2 3 137, 2 557, 2 2 17 2, 1171, 23 53, 2 617, 2 4 79. Since the primes l = 11, 17, 23, 29, 31, 47, 61, 73, 79, 83, 97, 103, 137, 167, 173, 197, 211, 227, 257, 317, 557, 571, 617, 731, 919, 991, 1171 are all anisotropic for (q) = 5460, these values may be eliminated, together with, by Lemma 27, any value of k which is divisible by 4. We are left with k = 1. Case 2: Suppose that 3 k and gcd(5 7 13, k) = 1. Substituting x = 3X as usual, we descend to the form q 2 (x, y) = 3x 2 + (5 7 13)y 2 = Kp, with 1 K < 455. As above, we may assume that gcd(3, K) = 1. Reducing modulo 3, 5, 7 and 13 gives us the conditions K Kp 5 7 13 = = = 1, 3 3 3 K Kp 3 5 5 5 K Kp 3 7 7 7 K Kp 3 = = = 1. 13 13 13 The values of K meeting these conditions, in factored form, are K = 17, 2 19, 2 31, 2 2 17, 2 3 19, 173, 2 3 31, 257, 2 4 17,

20 PETE L. CLARK Each such K is divisible by an anisotropic prime for (q 2 ) = (q). Case 3: Suppose that 5 k and gcd(3 7 13, k) = 1. Substituting x = 5X as usual, we descend to the form q 3 (x, y) = 5x 2 + (3 7 13)y 2 = Kp, with 1 K < 273. As above, we may assume that gcd(7, K) = 1. Reducing modulo 3, 5, 7 and 13 gives us the conditions K Kp 5 3 3 3 K Kp 273 5 5 5 K Kp 5 7 7 7 K Kp 5 = = = 1. 13 13 13 The values of K meeting these conditions, in factored form, are K = 47, 83, 2 61, 167, 2 2 47, 227. Each such K is divisible by an anisotropic prime for (q 3 ) = (q). Case 4: Suppose that 7 k and gcd(3 5 13, k) = 1. Substituting x = 7X as usual, we descend to the form q 4 (x, y) = 7x 2 + (3 5 13)y 2 = Kp, with 1 K < 195. As above, we may assume that gcd(7, K) = 1. Reducing modulo 3, 5, 7 and 13 gives us the conditions K Kp 7 = = = 1, 3 3 3 K Kp 7 5 5 5 K Kp 3 5 13 = = = 1, 7 7 7 K Kp 7 = = = 1. 13 13 13 The values of K meeting these conditions, in factored form, are K = 73, 97, 11 17. Each such K is divisible by an anisotropic prime for (q 4 ) = (q). Case 5: Suppose that 13 k and gcd(3 5 7, k) = 1. Substituting x = 13X as usual, we descend to the form q 5 (x, y) = 13x 2 + (3 5 7)y 2 = Kp, with 1 K < 105. As above, we may assume that gcd(7, K) = 1. Reducing modulo 3, 5, 7 and 13 gives us the conditions K Kp 13 = = = 1, 3 3 3 K Kp 13 5 5 5 K Kp 13 ( K 13 7 ) = ( Kp 13 7 7 ) ( ) 3 5 7 = = 1. 13