Why is $ p-a$ a quadratic residue if $a$ is a quadratic residue?

187 Views Asked by At

In solutions to the following question I am not sure why -1 being a quadratic residue implies that if $a$ is a quadratic residue then $p-a$ also is?

Any help would be much appreciated!

enter image description here

enter image description here

2

There are 2 best solutions below

0
On BEST ANSWER

$a$ is a quadratic residue modulo $p$ means $$\Big(\frac{a}{p}\Big)=1.$$ Now, consider $p-a$. Then $$\Big(\frac{p-a}{p}\Big)=\Big(\frac{-a}{p}\Big)=\Big(\frac{-1}{p}\Big)\Big(\frac{a}{p}\Big)=1,$$ since we are given that $-1$ is quadratic residue modulo $p$ too.

0
On

Suppose we find $c,d$ with $c^2\equiv -1$ and $d^2\equiv a \bmod p$, which we know is possible.

Then $(cd)^2\equiv c^2d^2 \equiv -a\equiv p-a\bmod p$