For , quadratic reciprocity gives
The second Legendre symbol is when and when . Combining it with the sign determined by shows that a quadratic residue occurs precisely for
For odd , quadratic reciprocity has no sign factor because :
The nonzero squares modulo are , so the answer for odd primes is . The excluded-prime wording also allows , where has a square root. Thus the full answer is
The primes both work, with the zero residue as a solution. For every other prime, multiplicativity of the Legendre symbol and quadratic reciprocity give
The first factor is positive for ; the second is positive for . They must have the same sign. The Chinese remainder theorem therefore yields

Articles by others on the same topic (0)

There are currently no matching articles.