How is 4 a quadratic residue of 7?

1.6k Views Asked by At

On Wolfram's dictionary, it shows that the quadratic residues of 7 are 1,2,4. It shows that the quadratic residues of 5 are 1,4. I tested 1 and 4, and as you can see: $$1^2 = 1 \pmod 5$$ and $$ 4^2= 16 \pmod 5 = 1 \pmod 5$$ since 5*3 = 15

If $4^2 = 16 \pmod 7 = 2 \pmod 7$

Doesn't this mean it would fail the criterion that a quadratic residue must be congruent to a perfect square modulo p (here, p = 7) ? Doesn't it need to always be congruent to $1 \pmod p$ ?