The Least Number with Prescribed Legendre Symbols
aa r X i v : . [ m a t h . N T ] O c t THE LEAST NUMBER WITH PRESCRIBEDLEGENDRE SYMBOLS
BRANDON HANSON, ROBERT C. VAUGHAN, AND RUIXIANG ZHANG
Abstract.
In this article we estimate the number of integers upto X which can be properly represented by a positive-definite, bi-nary, integral quadratic form of small discriminant. This estimatefollows from understanding the vector of signs that arises fromcomputing the Legendre symbol of small integers n at multipleprimes. Introduction
A well-known and outstanding problem in number theory is the es-timation of the least quadratic non-residue modulo a prime p . Recall,the least quadratic non-residue modulo p is the integer n p = min (cid:26) n > (cid:18) np (cid:19) = − (cid:27) , where (cid:16) xp (cid:17) is the Legendre symbol of x modulo p . Vinogradov conjec-tured that for any ε > n p should be at most p ε provided p is suffi-ciently large relative to ε . This conjecture is still open, however Linnikproved that any exceptions to it are sparse. Specifically, he proved theconjecture holds for all but O (log log N ) of the primes p ≤ N , with theimplied constant depending only on ε .Now suppose p and p are distinct, odd primes and n is an inte-ger not divisible by either. There are four possibilities for the vector (cid:16)(cid:16) np (cid:17) , (cid:16) np (cid:17)(cid:17) . How large must N be so that all four vectors are real-ized by integers bounded by N ? In general, one might ask the following. Problem 1.
Given distinct odd primes p , . . . , p k , how large must N bebefore one has seen each of the k different vectors of signs in { , − } k realized by a vector of the from (cid:18)(cid:18) np (cid:19) , . . . , (cid:18) np k (cid:19)(cid:19) with ≤ n ≤ N ? We believe that the above problem is intrinsically interesting, butthere is further motivation studying it. Recall that the quadratic form F ( x, y ) = Ax + Bxy + Cy has discriminant d = B − AC , is said torepresent q if F ( x, y ) = q has a solution ( x, y ) ∈ Z with x and y , andis said to properly represent q if furthermore x and y can be taken tobe relatively prime. We say the form is definite if d <
0. One couldthen ask,
Problem 2.
What is the least positive integer d such that q is repre-sented by a quadratic form of discriminant − d ? If we allow for indefinite forms, which is to say forms with positivediscriminant, then this problem is less interesting. A number is a dif-ference of squares if and only if it is not congruent to 2 mod 4. Thus,either q is not congruent to 2 mod 4 and q = x − y has a solution, orelse q/ q = 2 x − y has asolution.As is outlined below, answering Problem 2 essentially amounts tothe solution of Problem 1, because of the following theorem (see forinstance [B, Proposition 4.1]). Theorem 1.
The number q is properly represented by a binary qua-dratic form of discriminant d if and only if d is a square modulo q . When q is an odd prime and q ≡ q . But whenhandling Problem 2 for general q , rather than have (cid:16) − dq (cid:17) = −
1, werequire that (cid:16) dp (cid:17) = ( − p − for each odd prime p dividing q . Thuswe are interested in prescribing the Legendre symbol of d at severalprimes, which returns us to Problem 1.One goal of this article is to extend Linnik’s result on the least non-residue and show that one can usually prescribe the sign of the Legendresymbol simultaneously at many primes with a small integer, barringsome “local” obstructions as described in the next section. HE LEAST NUMBER WITH PRESCRIBED LEGENDRE SYMBOLS 3 Notation, preliminary observations, and statement ofresults
To begin, let k ≥ p , . . . , p k ≤ N be distinct oddprimes. Let p = ( p , . . . , p k ), q = p · · · p k and write (cid:18) n p (cid:19) = (cid:18)(cid:18) np (cid:19) , . . . , (cid:18) np k (cid:19)(cid:19) . Finally, denote by G = {± } k the (multiplicative) group of all k -tupleswith entries ±
1. As described in the introduction, we are interested inthe number n q = max e ∈ G min (cid:26) n : n ≥ , (cid:18) n p (cid:19) = e , n ≡ (cid:27) . Thus n q is the least positive integer such that we observe all possi-ble sign choices for (cid:16) n p (cid:17) with integers less than n q and congruent to1 mod 8. The congruence condition allows us to further insist thatwe deal only with squares modulo a power of two, which is needed inapplications.It is convenient to identify the group G with F k = ( Z / Z ) k , thevector space of dimension k over the field F , in the natural way. Tobe concrete, set U q ( y ) = { n : 1 ≤ n ≤ y, ( n, q ) = 1 , n ≡ } . Consider the map θ q : U q ( y ) → F k given by θ q ( n ) = (cid:18) (cid:18) − (cid:18) np (cid:19)(cid:19) , . . . , (cid:18) − (cid:18) np k (cid:19)(cid:19)(cid:19) mod 2 . The i ’th entry of θ q ( n ) is 1 mod 2 if n is a quadratic non-residue modulo p i and 0 mod 2 if n is a quadratic residue modulo p i . The map θ q is alsoan additive function in the sense that θ q ( mn ) = θ q ( m ) + θ q ( n ), with theaddition operation belonging to F k . Moreover, for y sufficiently largethe map θ q is surjective by Chinese Remainder Theorem and the factthat the primes p i are distinct and odd.Suppose we know that the integers in U q ( y ) span F k , in the sensethat { θ q ( n ) : n ∈ U q ( y ) } contains a basis of F k . Then n q ≤ y k . Indeed,any vector e ∈ F k is the sum of at most k basis vectors, each of whichis of the form θ q ( m ) with m ≤ y . The product of these integers m gives BRANDON HANSON, ROBERT C. VAUGHAN, AND RUIXIANG ZHANG an integer n with θ q ( n ) = e . It is therefore sensible to consider thenumber g q = min (cid:8) y : { θ q ( n ) : n ∈ U q ( y ) } spans F k (cid:9) . We record the above observation as a lemma.
Lemma 1.
Let q = p · · · p k be an odd, square-free integer. Then n q ≤ g kq . We have so far reduced the problem of bounding n q to that of bound-ing g q . In the spirit of Linnik, we would like to estimate the number of q for which g q is large. However, we need to be mindful of the followingobstruction. If g d > y for some divisor d of q then g q > y as well. Thus,if d is small and g d > y , then g q > y for at least [ Q/d ] numbers up to Q (the multiples of d ), which is substantial. So, we need to restrict ourattention to what we will call eligible q , namely those which are notdivisible by some d for which g d is large. In fact, for technical reasons,we have need to consider the number g q,r defined as g q,r = min (cid:8) y : { θ q ( n ) : n ∈ U qr ( y ) } spans F k (cid:9) . Notice that in this latter definition, we want to generate the full groupof signs with numbers not just coprime to q but also to r . Definition.
Let y ≥ be a parameter. We say q is y -eligible if foreach divisor d of q with < d < q , we have g d,q ≤ y . Otherwise, we say q is y -ineligible. If g q > y and q is y -eligible, we say q is y -exceptional. So, an odd prime p is always y -eligible, and is y -exceptional if n p > y .It also becomes clear why we need to introduce the the notion of g q,r :it may be that g d ≤ y for each proper divisor d of q , but in order toget this full set of generators, we must use numbers which are coprimeto d but not coprime to q .We now state our main results. Main Theorem.
Let a ≥ be fixed. Suppose Q ( Q, a ) is the set ofall integers q ≤ Q which are odd, square-free, and (log q ) a -exceptional.Then, for δ > , we have Q ( Q, a ) ≪ δ,a Q /a + δ . HE LEAST NUMBER WITH PRESCRIBED LEGENDRE SYMBOLS 5
Recall that the square-free radical of q is r = Q p | q p . Corollary 1.
Let ε ∈ (0 , . There are positive numbers a and c whichdepend only on ε and such that the following holds. For Q sufficientlylarge in terms of ε , there are at least cQ ε (log log Q ) − numbers q ∈ [ Q, Q + Q ε ] such that g r ≤ (log r ) a , where r is the square-free radicalof q . As applications of the Main Theorem, we have the following corol-laries.
Corollary 2.
Let ε > and let Q be sufficiently large in terms of ε . There is an integer in the interval [ Q, Q + Q ε ] which is properlyrepresented by a definite, binary quadratic form of discriminant − d with d ≤ Q ε . Corollary 3.
Let ε > and let Q be sufficiently large in terms of ε .There is an integer q in the interval [ Q, Q + Q ε ] which can be writtenas q = 1 u x + vu y with ≤ u, v ≤ Q ε and u = 0 . This final corollary can be compared with the problem of boundingthe gaps between consecutive sums of two squares. Being that there areabout x (log x ) − / integers up to x which are a sum of two squares, onemight expect that the gaps between such integers are at most (log x ) c for some positive constant c . However the best known bound, due toBambah and Chowla [BC], is that there is a integers between x and x + O ( x / ) which is a sum of two squares. Corollary 3 says that onehas much smaller gaps if we weaken squares to numbers which are ina sense “almost-squares”.3. Facts from analytic number theory
Here we recall some required background results from analytic num-ber theory. Let S ( x, y ) = { n ≤ x : p | n = ⇒ p ≤ y and p = 1 mod 8 } BRANDON HANSON, ROBERT C. VAUGHAN, AND RUIXIANG ZHANG and for a positive integer q , let S q ( x, y ) = { n ∈ S ( x, y ) : ( n, q ) = 1 } . We need to estimate these sets. To begin, we have the following whichis a modification of Corollary 7.9 from [MV].
Theorem 2.
Suppose a is in the range ≤ a < (log x ) / / (2 log log x ) and let δ > . Then for x sufficiently large and q ≤ x , x − /a − δ ≪ δ,a | S q ( x, (log x ) a ) | ≤ | S ( x, (log x ) a ) | ≪ δ,a x − /a + δ . Proof.
Let y ≥ (log x ) and let P = { p , . . . , p T } denote the set ofprimes p ≤ y with p = 1 mod 8 and which do not divide q . Anyproduct of primes in P which does not exceed x belongs to S q ( x, y ).By the Prime Number Theorem in arithmetic progressions (Corollary11.21 in [MV]), we have π ( y ; 8 ,
1) = y log y (cid:18)
14 + o (1) (cid:19) . Since ω ( n ) is maximized when n is a primorial number ω ( q ) ≪ log q log log q ≤ log x log log x . Because y ≥ (log x ) , for x sufficiently large, T ≥ y y . Now considerany product of primes in P . Its logarithm is of the form T X j =1 v j log p j ≤ log y T X j =1 v j . Thus a lower bound for | S q ( x, y ) | is the number of vectors N = (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)( ( v , . . . , v T ) ∈ Z T : v j ≥ , T X j =1 v j ≤ (cid:20) log x log y (cid:21))(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) . Letting U = h log x log y i , it is a simple combinatorial argument (see Lemma7.7 of [MV]) that the number of such vectors is N = (cid:18) T + UT (cid:19) . By Stirling’s Formula, n ! ≍ n n +1 / e − n HE LEAST NUMBER WITH PRESCRIBED LEGENDRE SYMBOLS 7 so that N ≫ ( U + T ) U + T +1 / e − U − T U U +1 / e − U T T +1 / e − T ≥ (cid:18) U + TU (cid:19) U √ U .
The right hand side above is increasing in T , thus N ≫ (cid:18) y U log y (cid:19) U √ U . If u = log x log y then u − ≤ U ≤ u ≤ y log y . Thus N ≫ (cid:18) y u log y (cid:19) u − √ u . For the exponent − / √ u we note that1 √ u u log yy ≥ y and thus N ≫ y (cid:18) y x (cid:19) log x log y = xy exp (cid:18) − log x log y log(5 log x ) (cid:19) Now we take y = (log x ) a where 2 ≤ a < (log x ) / / (2 log log x ). Thenwe get N ≫ x − a exp (cid:18) − a log log x − log 5 log xa log log x (cid:19) ≫ δ,a x − /a − δ . For the upper bound, trivially | S q ( x, (log x ) a ) | is less than | S ( x, (log x ) a ) | ,which is in turn at most the number of (log x ) a -smooth numbers up to x . There are at most O δ,a ( x − /a + δ ) such numbers by Corollary 7.1 of[MV]. (cid:3) The main ingredient we need for the proof of our main theorems isa Large Sieve inequality. This one can be found in [IK, Theorem 7.13].
Theorem 3 (Large Sieve) . Let Q ≥ and let ( a n ) n ≤ x be a sequence ofcomplex numbers. Then X q ≤ Q qϕ ( q ) X ′ χ mod q (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)X n ≤ x a n χ ( n ) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) ≪ ( Q + x ) X n ≤ x | a n | . BRANDON HANSON, ROBERT C. VAUGHAN, AND RUIXIANG ZHANG
In the above sum over χ we mean that the summation occurs over allprimitive characters χ of modulus q . In order to make Lemma 1 useful, we need to have integers witha reasonable number of prime factors. The next lemma tells us suchintegers are ubiquitous.
Lemma 2.
Let ε ∈ (0 , and K ≥ be fixed. For all Q sufficientlylarge in terms of ε , there are at most O (cid:0) Q ε (log log Q ) − K (cid:1) integers q ∈ [ Q, Q + Q ε ] with at least (log log Q ) K +1 prime factors.Proof. Let u ∈ [1 , Q ] be a number to be determined later. Write ω u ( q ) = X p | qp ≤ u . Then ω ( q ) − ω u ( q ) = X p | qp>u ≤ u X p | q log p ≤ log q log u . The number of integers q in question is at most(log log Q ) − K − X Q ≤ q ≤ Q + Q ε ω ( q ) ≤ (log log Q ) − K − X Q ≤ q ≤ Q + Q ε ω u ( q ) + 2 Q ε (log log Q ) − K − log Q log u . To estimate the sum, X Q ≤ q ≤ Q + Q ε ω u ( q ) ≤ X p ≤ u Q ε p + O ( u ) ≪ Q ε log log Q + O ( u ) . Taking u = Q ε gives the bound O (cid:18) Q ε (log log Q ) K + Q ε ε (log log Q ) K +1 (cid:19) = O (cid:18) Q ε (log log Q ) K (cid:19) once Q is sufficiently large in terms of ε . (cid:3) Finally, in order to guarantee that we can find y -eligible numbers inshort intervals, we will need a basic consequence of Brun’s Pure Sieve.This result can be read from Corollary 6.2 in [FI]. HE LEAST NUMBER WITH PRESCRIBED LEGENDRE SYMBOLS 9
Theorem 4.
Let a ≥ and ε > be fixed. Then the number ofintegers in the interval [ Q, Q + Q ε ] with no prime divisor less than z isasymptotic to Q ε V ( z ) , where V ( z ) = Q p The following lemma provides the key reduction to a problem whichis approachable by the Large Sieve. Lemma 3. Let q be an odd, square-free, and y -exceptional number.Then for any n ∈ S q ( x, y ) , we have (cid:18) nq (cid:19) = Y p | q (cid:18) np (cid:19) = 1 . Proof. For convenience, write k = ω ( q ), write q = p · · · p k , and denoteby Θ q ( y ) = θ q ( U q ( y ))the image of U q ( y ) in F k . Since q is y -exceptional we have g q > y , andso Θ q ( y ) spans a proper subspace of F k , say H . A number n ∈ S q ( x, y )is a product of primes in U q ( y ). Thus, writing n = Q p | n p v p , we have θ q ( n ) = X p v p θ q ( p ) ∈ H since θ q ( p ) ∈ H for each p occurring in the sum. Since H is a propersubspace, there is a non-zero vector in H ⊥ . In other words, for somenon-empty subset I ⊆ { , . . . , k } , each vector ( x , . . . , x k ) ∈ H satisfies X i ∈ I x i = 0 . In fact, we must have I = { , . . . , k } . To see this, suppose that I were aproper subset with | I | = l < k . Let d I = Q i ∈ I p i . Then the projection π I : H → F l given by π I ( x , . . . , x k ) = ( x i ) i ∈ I is not surjective. Indeed, any vector in the image has co-ordinateswhich sum to 0 mod 2. But this projection contains the image θ d I ( U q ( n )). So the proper divisor d I satisfies g d I ,q > y , which violates the y -eligibility of q . Thus the each element of H satisfies P ki =1 x i = 0which means that Y p | q (cid:18) np (cid:19) = 1for any n ∈ S q ( x, y ). (cid:3) We now prove our main theorem. The proof boils down to Linnik’sresult on the least number n χ for which a primitive character χ satisfies χ ( n χ ) = 1. The result is stated but not proved, in [DK]. A proof isgiven in [Pol1] (Lemma 5.3), and we will will follow in much the samemanner. Proof of Main Theorem. Fix δ > 0. Let C a,δ be a constant dependingonly on a and δ which is at our disposal, and let x > C a . We will workdyadically, and apply Theorem 3 with a n = ( n ∈ S ( x , (log x ) a )0 otherwise.Suppose q ∈ Q ( Q, a ) is in the range x < q ≤ x . Then S ( x , (log x ) a ) ⊆ S ( x , (log q ) a ) . So if n ∈ S ( x , (log x ) a ), then by Lemma 3, Y p | q (cid:18) np (cid:19) = ( n, q ) = 10 otherwise . It follows that X n ≤ x a n (cid:18) nq (cid:19) ≥ | S q ( x , (log x ) a ) | Suppose x is large enough so that it satisfies 2 − a > log( x ) − δ/ ,which will be guaranteed by increasing C a,δ as necessary. By Theorem2, | S q ( x , (log x ) a ) | = | S q ( x , − a (log x ) a ) |≥ | S q ( x , (log x ) a − δ/ ) |≫ δ,a x − / ( a − δ/ − δ/ ≫ δ,a x − /a − δ/ HE LEAST NUMBER WITH PRESCRIBED LEGENDRE SYMBOLS 11 by increasing C a,δ if necessary. Now we sum over all q ∈ Q x = Q ( Q, a ) ∩ ( x, x ] to get X q ∈Q x x − /a − δ/ ≪ δ,a X q ∈Q x qϕ ( q ) X ′ χ mod q (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) X n ≤ x a n χ ( n ) (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) ≪ δ,a x | S (cid:0) x , (log x ) a (cid:1) |≪ δ,a x − /a + δ/ . Rearranging, we see that |Q x | ≪ δ,a x /a + δ/ ≤ Q /a + δ/ for x ≤ Q . Summing over all x = 2 j in the range log ( C a,δ ) ≤ j ≤ log Q we get |Q ( Q, a ) | ≪ δ,a X j ≤ log Q |Q j | ≪ δ,a Q /a + δ . Here we have used that there is a contribution of O a,δ (1) from the termswith 2 ≤ q ≤ log ( C a,δ ) and the fact that log Q ≪ δ Q δ/ . (cid:3) Before proving the first corollary, we need some lemmas concerningeligibility. Lemma 4. If q is odd, square-free and y -ineligible, and if the leastprime dividing q is p , then q has a proper divisor d which is min { y, p − } -exceptional. In particular, if q is odd, square-free and y -ineligible,and if all prime factors of q exceed y + 1 , then q has a proper divisor d which is y -exceptional.Proof. Since q is y -ineligible it has a divisor d such that g d,q > y . Let d = min { d : d | q, < d < q, g d,q > y } . Then d is y -eligible. Indeed, if d were not y -eligible, it would havea proper divisor d ′ for which g d ′ ,d > y . But then, since d | q , we have g d ′ ,q ≥ g d ′ ,d > y contradicting the minimality of d . So d is y -eligiblebut g d ,q > y . Either g d > y as well and so d is y -exceptional, orelse g d ≤ y . In the latter case, the vectors θ d ( n ) with n ∈ U d ( y )generate the full group of signs for d , but those with n ∈ U q ( y ) do not.However, all of the elements of U d ( y ) \ U q ( y ) are divisible by some prime which is at least as big as p , and so g d > p − 1. It may now bethe case, since p − < y , that d is not p − d = min { d : d | d , < d < d , g d,d > p − } . As before, d is p − g d,d > p − 1. But in fact, since d isonly divisible by primes greater than p , U d ( p − 1) = U d ( p − g d > p − 1. Hence d is p − (cid:3) Lemma 5. If q is an odd, square-free integer which is (log q ) a -ineligible,and if all prime factors of q are at least q ) a , then q has a divisor d which is (log d ) a -exceptional.Proof. Since q is not (log q ) a -eligible then it has a divisor d which is(log q ) a -exceptional, by Lemma 4. Either d is also (log d ) a -exceptional(and we are done) or else it is not (log d ) a -eligible. In the latter caseit has a proper divisor d which is either (log d ) a -exceptional, or elsenot (log d ) a -eligible. Continuing in this fashion, we must arrive at adivisor d of q which is (log d ) a -exceptional. Indeed, eventually we wouldeither stop or arrive at a prime p , and this prime is (log p ) a -exceptionalsince all primes are y -eligible for all y > (cid:3) Proof of Corollary 1. Assume ε < / a be a positive number at our disposal, which will depend onlyon ε . Let B be the set of all numbers in [ Q, Q + Q ε ] which have noprime factors smaller than 2(log Q ) a . By Theorem 4, we have |B| ∼ Q ε · V (2(log Q ) a ) . Now, by Mertens’ theorem, − log V ( z ) = X p HE LEAST NUMBER WITH PRESCRIBED LEGENDRE SYMBOLS 13 Let B ′ ⊆ B be the subset of all elements of q ∈ B which have asquare-free radical r = Q p | q p satisfying g r > (log r ) a . For such q , r is either (log r ) a -exceptional or (log r ) a -ineligible. Now, all primefactors of r exceed 2(log r ) a . So, if r is (log r ) a -ineligible, it followsfrom Lemma 5 that r is divisible by a number d which is (log d ) a -exceptional. In either case, q has a divisor d which is square-free and(log d ) a -exceptional. Moreover, this divisor d satisfies d ≥ (log Q ) a since it is a non-empty product of primes exceeding (log Q ) a . Henceevery integer in B ′ is divisible by some d ∈ Q (2 Q, a ) which is at least(log Q ) a . It follows that the size of B ′ is at most X d ≥ (log Q ) a d ∈Q (2 Q,a ) (cid:18) Q ε d + O (1) (cid:19) ≪ Q ε Z Q (log Q ) a Q ( u, a ) u du + O ( Q (2 Q, a ))by partial summation. We apply our Main Theorem with δ = ε/ 4. Theintegral is at most O ε (1) · Q ε Z ∞ (log Q ) a u /a − ε/ du ≪ ε,a Q ε (log Q ) a (1 − ε/ − ≪ ε,a Q ε (log Q ) a/ , while Q (2 Q, a ) ≪ ε (2 Q ) /a + ε/ ≪ ε Q ε/ for a sufficiently large in terms of ε . Thus once a is sufficiently large interms of ε and Q is sufficiently large in terms of a , we have |B \ B ′ | ≫ εQ ε log log Q . The integers in B \ B ′ all have a square-free radical r with g r ≤ (log r ) a . (cid:3) Proof of Corollary 2. We can assume ε is small without any loss ofgenerality. By Theorem 1, it is enough to find some number q ∈ [ Q, Q + Q ε ] and a discriminant − d which is a square modulo 4 q . If ( d, q ) = 1,then in order for − d to be a square modulo 4 q , it suffices that(1) d ≡ (cid:16) dp (cid:17) = 1 for p | q and p ≡ (cid:16) dp (cid:17) = − p | q and p ≡ a such that the numberof integers in q ∈ [ Q, Q + Q ε ] with g q ≤ (log q ) a is at least c ε Q ε (log log Q ) − for some constant c ε depending only on ε . By Lemma 2, one of thesenumbers will have ω ( q ) ≤ (log log Q ) K for some K sufficiently large interms of ε . Let p be the smallest positive prime which is congruent to7 modulo 8 and which does not divide q . Then, since q has k = ω ( q ) ≤ (log log Q ) K prime factors, p is at most the k +1’th prime congruent to7 mod 8 which is at most O ( k log k ) = O ε ( Q ε/ ) by the Prime NumberTheorem. Since n q ≤ g ω ( q ) q ≤ (log q ) a (log log q ) K = O ε ( Q ε/ ) , we can find an integer d ≪ ε Q ε/ which is relatively prime to q , con-gruent to 1 modulo 8 so that d p = 7 mod 8, and such that (cid:16) d p p (cid:17) is prescribed as needed for each p dividing q . The number d = d p satisfies the desired properties and the corollary is proved. (cid:3) Recall that a binary quadratic form q ( x, y ) = Ax + Bxy + Cy of discriminant − d is called reduced if | B | ≤ A ≤ C . In this case d = 4 AC − B ≥ AC , so that all coefficients are bounded by d . Wesay two quadratic forms q ( x, y ) and q ( x, y ) are equivalent if one can beobtained from the other by an invertible, integral change of variables.To be precise, we have q ( αx + βy, γx + δy ) = q ( x, y ) for some integers α, β, γ, δ with αδ − βγ = 1. It is clear that equivalent forms representthe same numbers. This, combined with the following theorem, [B,Theorem 2.3], shows that there is no loss of generality in working withreduced forms. Theorem 5. Every binary quadratic form of discriminant − d is equiv-alent to a reduced form of the same discriminant. We are now ready to prove our final corollary. Proof of Corollary 3. By Corollary 2, we can represent an integer q in the range Q ≤ q ≤ Q + Q ε by some positive definite binary qua-dratic form Q of discriminant − d with d at most Q ε . Without lossof generality we may assume this form is reduced, and thus write q = Ax + Bxy + Cy with B − AC = − d for some A, B, C boundedin absolute value by Q ε . It follows that A, C > 0, and by completing HE LEAST NUMBER WITH PRESCRIBED LEGENDRE SYMBOLS 15 the square we see q = 14 A (cid:0) (2 Ax + By ) + dy (cid:1) . (cid:3) Acknowledgment We thank the anonymous referee for pointing out errors in the orig-inal draft of this article, and for helpful comments on the exposition.Part of this work was carried out while the first and third authorswere attending the IPAM reunion conference for the program Alge-braic Techniques for Combinatorial and Computational Geometry. References [BC] R. P. Bambah and S. Chowla, On numbers which can be expressedas a sum of two squares , Proc. Nat. Inst. Sci. India 13, (1947).101-103.[B] D. A. Buell, Binary Quadratic Forms, Classical theory and moderncomputations , Springer-Verlag, New York, 1989. x+247 pp.[DK] W. Duke and E. Kowalski, A problem of Linnik for elliptic curvesand mean-value estimates for automorphic representations , In-vent. Math. 139 (2000) 1-39.[FI] J. Friedlander and H. Iwaniec, Opera de Cribro , American Math-ematical Society Colloquium Publications, 57. American Mathe-matical Society, Providence, RI, 2010.[IK] H. Iwaniec and E. Kowalski, Analytic Number Theory , Ameri-can Mathematical Society Colloquium Publications, 53. AmericanMathematical Society, Providence, RI, 2004.[MV] H. L. Montgomery and R. C. Vaughan, Multiplicative NumberTheory 1. Classical Theory , Cambridge, 2007.[Pol1] P. Pollack, The average least quadratic nonresidue modulo m and other variations on a theme of Erd¨os , J. Number Theory 132(2012), 1185-1202. Pennsylvania State University, University Park, PA E-mail address : [email protected] Pennsylvania State University, University Park, PA E-mail address : [email protected] Princeton University, Princeton, NJ E-mail address ::