Q:

Square root of a number modulo $p$ where $p\equiv3\bmod4$

I know that for $a\in\Bbb N$ and $p$ prime, where $p\nmid a$, if $p\equiv3\bmod4$ we can solve $x^2\equiv a\bmod p$ easily with the equation
$$x=\pm a^{(p+1)/4}$$
I tried this with $a=6$ and $p=23$ and got the an answer of 12, which is correct, but 11 is also supposed to be a square root of $6\bmod23$. Is this a contradiction? Why didn't the formula work?

A:

Note that
$$11\equiv-12\bmod23$$
and that if $x^2\equiv a\bmod p$ then $(-x)^2\equiv a\bmod p$.
Basic algebraic manipulations work much the same way in modular arithmetic as they do in ordinary arithmetic.

