square roots in multiplicative group of integers modulo n

344 Views Asked by At

How do I exactly determine all solutions for square roots if they exists and what to do if for one square root exist two solutions?

Let's for example take the Group $(\mathbb{Z}/7\mathbb{Z})$ with \begin{align*} &1\cdot1\equiv1\mod7\\ &2\cdot2\equiv4\mod7\\ &3\cdot3\equiv2\mod7\\ &4\cdot4\equiv2\mod7\\ &5\cdot5\equiv4\mod7\\ &6\cdot6\equiv1\mod7 \end{align*}

The formula used here is for elliptic curve computation in $(\mathbb{Z}/n\mathbb{Z})$: \begin{align*} y&\equiv\sqrt{0^3+0+1}\equiv1\mod 7\\ y&\equiv\sqrt{1^3+1+1}\equiv\sqrt{3}\mod7\text{ no solution}\\%\approx\pm1.732\\ y&\equiv\sqrt{2^3+2+1}\equiv\sqrt{4}\equiv5\mod7\\ y&\equiv\sqrt{3^3+3+1}\equiv\sqrt{31}\equiv\sqrt{3}\text{ no solution}\\%\approx\pm5.568\\ y&\equiv\sqrt{4^3+4+1}\equiv\sqrt{69}\equiv\sqrt{6}\text{ no solution}\\%\approx\pm8.306\\ y&\equiv\sqrt{5^3+5+1}\equiv\sqrt{131}\equiv\sqrt{5}\text{ no solution}\\%\approx\pm11.446\\ y&\equiv\sqrt{6^3+6+1}\equiv\sqrt{223}\equiv\sqrt{6}\text{ no solution}\\%\approx\pm14.933\\ y&\equiv\sqrt{2^3+2+1}\equiv\sqrt{11}\equiv\sqrt{4}\equiv5\mod7\\%\approx\pm3.317\\ y&\equiv\sqrt{3^3+3+1}\equiv\sqrt{31}\equiv\sqrt{3}\text{ no solution}\\%\approx\pm5.568\\ y&\equiv\sqrt{4^3+4+1}\equiv\sqrt{69}\equiv\sqrt{6}\text{ no solution}\\%\approx\pm8.306\\ y&\equiv\sqrt{5^3+5+1}\equiv\sqrt{131}\equiv\sqrt{5}\text{ no solution}\\%\approx\pm11.446\\ y&\equiv\sqrt{6^3+6+1}\equiv\sqrt{223}\equiv\sqrt{6}\text{ no solution}%\approx\pm14.933 \end{align*} For every square are two solutions possible. I think one of these has to be something similar like the negative solution (e.g. $-4\equiv3\mod 7$) even if like somebody said negative solutions doesn't exist (what I still think is crap because of $\mathbb{Z}$). How to determine which in every case is the correct one? Can two solutions for one x exist for for an elliptic curve computation in $(\mathbb{Z}/n\mathbb{Z})$?

Concerning the negative number problem I add a different question:

Why is $3\equiv\sqrt{2}\equiv4\mod7$ when it isn't?

This question probably also explains my confusion.