Least Non-Square Quadratic Residue

263 Views Asked by At

There's a lot of work on the least quadratic non-residues for a given modulus p (usually prime), with research on bounds and distributions providing some interesting results.

The justification for focusing on non-residues is typically that the least residue is trivial since 1 is a square for all integer moduli. Of course, all square numbers are trivially quadratic residues for all moduli. But what about the smallest non-trivial quadratic residue? That is, the smallest non-square quadratic residue?

Denote $ \theta (n) $ the least non-square quadratic residue for modulus $n$, where $ \theta (n) = 0 $ if there is not a non-square quadratic residue . The chart below shows the value of $\theta (n) $ for $2 \leq n \leq 1000$.

enter image description here

One observation I have made is that local maxima of this function often occur when $n$ is a highly smooth number (factorisation contains small primes), and the corresponding value $\theta(n)$ is also often 1 larger than a smooth number (but not always).

For example, the sequential maxima (red dots) for the chart above are:

$$ \theta(6 = 2 \cdot 3) = 3 = 1 + 2 \\ \theta(9 = 3^2 ) = 7 = 1 + 2 \cdot 3 \\ \theta(24 = 2^3 \cdot 3) = 12 = 1 + 11 \\ \theta(32 = 2^5) = 17 = 1 + 2^4 \\ \theta(40 = 2^3 \cdot 5) = 20 = 1 + 19 \\ \theta(48 = 2^4 \cdot 3) = 33 = 1 + 2^5 \\ \theta(144 = 2^4 \cdot 3^2) = 52 = 1 + 3 \cdot 17 \\ \theta(240 = 2^4 \cdot 3 \cdot 5) = 84 = 1 + 83 \\ \theta(480 = 2^5 \cdot 3 \cdot 5) = 96 = 1 + 5 \cdot 19 \\ \theta(720 = 2^4 \cdot 3^2 \cdot 5 ) = 145 = 1 + 2^4 \cdot 3^2 $$

Furthermore, for $ n \leq 100000$ the maximum value of $\theta (n)$ is obtained when $n = 50400, \theta(n) = 721 $, with $ 50400 = 2^5 \times 3^2 \times 5^2 \times 7 $ and $ 721 = 1 + 2^4 \times 3^2 \times 5$

I guess my question is whether anyone knows of any existing research on this kind of function? Any recommendations welcome! Thanks.