For coefficients supported on an interval of length , write and . The variance form of the large sieve states
The constant is absolute. One may take the explicit right side , by orthogonality of roots of unity and the exponential-sum large sieve proved in Question 2.
Take , , and the indicator function of the -smooth numbers up to . Applying the given smooth-number density with parameter gives
with a harmless adjustment of the constant for integer endpoints. If an odd prime has least quadratic nonresidue , then : a quadratic nonresidue always occurs among . Every prime factor of every selected smooth number is thus a nonzero quadratic residue modulo . By the multiplicativity of the Legendre symbol, every selected number is a nonzero quadratic residue modulo .
There are nonzero quadratic nonresidue classes, and on all of them. Their contribution to the variance is at least
If denotes the number of exceptional primes, the variance form of the large sieve, with , yields . Consequently
This is the bounded exceptional primes for least quadratic nonresidues argument. Using an interval of length is what matches the term; an interval of length would not give a bounded exceptional set.
Write an integral binary quadratic form as , with discriminant of a binary quadratic form . It is positive definite when and . Two forms are equivalent if one is obtained from the other by an integral linear change of variables whose matrix lies in . A positive definite form is reduced when
with when or .
To reduce a form, apply a unimodular shear with chosen so that the new middle coefficient has . If the new final coefficient is smaller than , exchange the variables, using a determinant-one rotation, so that the positive leading coefficient decreases from to . Repeating must stop because a positive integer cannot decrease indefinitely. At termination , and elementary sign changes impose the boundary convention. This is the reduction algorithm for a positive definite binary quadratic form, and proves that every positive definite form is equivalent to a reduced one.
The displayed forms have discriminant , so the intended discriminant is . For any reduced form of this discriminant, enumeration of reduced binary quadratic forms gives
The boundary convention and direct checking of leave only
Suppose first that a prime is represented by . The identity
shows modulo both and that is a nonzero square. Hence
Similarly,
Modulo , this says is a square, while modulo it says is a square. Since , the multiplicativity of the Legendre symbol gives
Conversely, suppose the two displayed Legendre symbols have the same sign. By quadratic reciprocity,
Choose an odd integer satisfying . Since is odd, is also divisible by , so
is a positive definite integral form of discriminant that represents . Reducing yields either or , and equivalence preserves represented integers. The necessary symbol calculation above determines which one: the positive pair selects , and the negative pair selects . Therefore
Write . Choose a quadratic nonresidue . Multiplication by permutes , while multiplicativity of the Legendre symbol gives . Therefore
so the complete Legendre-symbol sum is zero.
Since and , the bijection reduces the next sum to . Count pairs satisfying . On one hand their number is
On the other hand , and every gives exactly one pair by , . There are therefore pairs, proving the quadratic Legendre-symbol correlation
For , the indicator that both and are quadratic residues is . Summing and using the two identities above gives the number of consecutive nonzero quadratic residues modulo an odd prime
For an odd prime number , the Legendre symbol is
If , multiplicativity of the Legendre symbol gives
Both factors belong to , so they are equal. Thus .