<s>[INST] Modular Quadratic Equation I'm trying to solve that equation:
$x^2-3x-5\equiv0\pmod{343}$
I've completed the square as follows:
$x^2-3x-5 \equiv x^2+340x-5\equiv(x+170)^2-170^2-5\pmod{343}\\
(x+170)^2 \equiv 93\pmod{343}\\
y^2 \equiv 93 \pmod{343}$
But I have no idea how to move on. How can I use the fact that $343=7^3$?
 [/INST] $$y^2\equiv93\pmod{343}\implies y^2\equiv93\pmod{49}\implies y^2\equiv93\pmod{7}$$
From the last congruence we get $y\equiv\pm3\pmod 7$ or $y=7z\pm 3$. Now, plug this into the second congruence to get
$$\pm21z+9\equiv-5\pmod{49}$$
or
$$\pm3z\equiv-2\pmod 7\iff z\equiv\mp3\pmod 7$$
so $z=7u\mp 3$ and $y=7(7u\mp 3)\pm 3=49u\mp21\pm 3$. So $y=49u\pm 18$.
Finally, put this into the first congruence:
$$\pm49u+324\equiv 93\pmod{343}$$
The rest should be quite straightforward.
</s>