How to find all positive integers whose square ends in $444$?

This is solving $$x^2\equiv444\pmod{1000}.$$ By the Chinese remainder theorem, this is equivalent to the two congruences $$x^2\equiv444\equiv4\pmod{8}$$ and $$x^2\equiv444\equiv69\pmod{125}.$$ The solution of the first is $x\equiv2\pmod4$ and that of the second is $x\equiv\pm38\pmod{125}$. Putting these together using CRT gives $x\equiv\pm38\pmod{500}$. This means that $x$ ends in $038$ or $462$ or $538$ or $962$.


$$n^2\equiv444\pmod{1000}\equiv38^2$$

$$\implies n^2\equiv38^2\pmod8\equiv4$$

$\implies8\mid(n+2)(n-2)$

As $n$ is even,

$\implies2\mid\dfrac{n+2}2\cdot\dfrac{n-2}2$

In either case

$$n\equiv2\pmod4\ \ \ \ (1)$$

and $n^2\equiv38^2\pmod{125}\implies n\equiv\pm38\pmod{125}\ \ \ \ (2)$

as $125=5^3$ has primitive roots, $m^2\equiv1\pmod{5^3}$ will have exactly two in-congruent roots.

Now apply Chinese Remainder Theorem