In practice, it suffices to restrict the range to because of the symmetry in :

So for example, in :

Read more:

[https://math.stackexchange.com/questions/1195366/all-the-solvable-congruences-x2-equiv-a-pmod-n-have-the-same-number-of-solu]

[https://en.wikipedia.org/wiki/Quadratic_residue]

[https://mathworld.wolfram.com/QuadraticResidue.html]