Consecutive Non-Quadratic Residues – nt.number-theory,quadratic-reciprocity

nt.number-theoryquadratic-reciprocity

Inspired by this recent question, I wondered if a similar result is true for quadratic non-residues, namely, if it is true that for every $k \in \mathbb{N}$ there exists a prime $p$ such that exists $k$ consecutive quadratic non-residues mod $p$? or even a stronger result like for every $k \in \mathbb{N}$ there exists $N$ such that for every prime $p > N$ we have $k$ consecutive quadratic non-residues mod $p$?

Obviously, the idea used in the link could not be adapted to this case because it relies on the fact that the product of two quadratic residues is a quadratic residue, which is not true for quadratic non-residues. I searched the web and did not find anything relevant on this question. Does anybody have any ideas?

Thank you!

PS: If anyone could give me a reference to a book that approaches this kind of problems (consecutive quadratic or non-quadratic residues), I would be grateful.

Best Answer

The answer to both your questions is positive and indeed, every given pattern of quadratic residues and non-residues of fixed length appears among consecutive elements of ${\mathbb F}_p$, for all $p$ large enough; moreover, it appears about the expected number of times. This is non-trivial, but fairly standard.

Fix $\epsilon=(\epsilon_1,\ldots,\epsilon_k)\in\{-1,1\}^k$ ("the pattern") and for a prime $p$, let $N_\epsilon(p)$ denote the number of those $x\in{\mathbb F}_p$ with $$ \left(\frac{x+1}p\right)=\epsilon_1,\ldots, \left(\frac{x+k}p\right)=\epsilon_k, $$ where $\left(\frac xp\right)$ is the Legendre symbol. Clearly, we have \begin{align*} N_\epsilon(p) &= 2^{-k}\sum_{x=0}^{p-k-1} \prod_{j=1}^k \left(1+\epsilon_j\left(\frac{x+j}{p}\right) \right) \\ &= 2^{-k}\sum_{x=0}^{p-1} \prod_{j=1}^k \left(1+\epsilon_j\left(\frac{x+j}{p}\right) \right) - \theta \frac k2,\quad 0\le \theta\le 1, \end{align*} as the contribution of each $x\in[p-k,p-1]$ to the whole sum is at most $2^{k-1}$.

Expanding the product, one can write $N_\epsilon(p)$ as a sum of the main term $2^{-k}\sum_x1=2^{-k}p$ and $2^k-1$ remainder terms, each of the form $2^{-k}\sum_x \left(\frac{Q(x)}p\right)$ with a non-square polynomial $Q(x)$ of degree at most $k$. Now, Weil's bound implies that each of these remainder terms does not exceed $(k-1)\sqrt p$ in absolute value; as a result, $$ N_\epsilon(p)=2^{-k}p+\theta k(\sqrt p+1/2),\ |\theta|<1, $$ which is certainly positive for $p$ sufficiently large (like $p>\exp(ck)$ with a suitable constant $c$).

This argument readily extends to count, say, the number of those elements $x$ of a finite field such that for a given system of square-free, pairwise co-prime polynomials $P_1,\ldots,P_k\in{\mathbb Z}[X]$, the values $P_1(x),\ldots,P_k(x)$ follow a prescribed quadratic residue / non-residue pattern. Indeed, in a similar way one can handle the joint distribution of $P_1(x),\ldots P_k(x)$ in the cosets of any subgroup of the multiplicative group of a finite field, not just the subgroup of quadratic residues.