TITLE: show that the set $\{M, M+1, \cdots, M+ 2\lfloor \sqrt{p} \rfloor +2\}$ contains a quadratic non-residue to modulus $p$
QUESTION [5 upvotes]: Let $M$ be an integer, and let $p$ be a odd  prime . Show that the set  $$ \{M+1,M+2,M+3,\cdots,M+ 2\lfloor \sqrt{p} \rfloor+2\}$$ contains a quadratic non-residue to modulus $ p$ for all primes $ p$
maybe can use this well know:
Smallest quadratic nonresidue is less than square root plus one An odd prime $p$,  $a$ is the smallest positive integer that is a quadratic nonresidue modulo $p$,then $a<1+\sqrt{p}$.
maybe can sove this problem?

REPLY [4 votes]: We know that there is a quadratic non-residue $n$ with $2\le n<\sqrt p+1$. Multiplying $n$ by the appropriate power of $4$, we can find a quadratic non-resdiue, say $n'$, in the range $\frac12\sqrt p<n'<2\sqrt p$. 
Consider the set 
  $$ S = \{Mn',(M+1)n',\dotsc,(M+2\lfloor\sqrt p\rfloor+2)n'\}\pmod p. $$
The "distance" in $\mathbb Z_p$ between any two consecutive elements of this set is $n'<2\lfloor\sqrt p\rfloor+2$, and there is no gap between the largest and the the smallest elements of the set since
  $$ (M+2\lfloor\sqrt p\rfloor+2)n' > Mn' + p. $$
It follows that every interval in $\mathbb Z_p$ of length $2\lfloor\sqrt p\rfloor+2$ contains at least one element of $S$. In particular, there is an element of $S$ contained in $\{M,M+1,\dotsc,M+2\lfloor\sqrt p\rfloor+2\}$. In other words, there are $x,y\in\{M,M+1,\ldots,M+2\lfloor\sqrt p\rfloor+2\}$ such that $y\equiv n'x\pmod p$. Since $n'$ is a non-residue, so is (exactly) one of $x$ and $y$.