# Find the greatest number $k$ such that there exists a perfect square that is not a multiple of 10, with its last $k$ digits the same

Find the greatest number $$k$$ such that there exists a perfect square that is not a multiple of 10, with its last $$k$$ digits the same

I could find $$12^2 = 144$$, $$38^2 = 1444$$, $$62^2 = 3844$$ and $$88^2 = 7744$$

By examination of squares considered $$\bmod 1000$$, the only possibility of three repeated non-zero digits terminating a square is $$444$$, arising from values $$\{38, 462, 538, 962\} \bmod 1000$$. Due to your finding for two repeated end digits, searching for these can just consider the values you found with added multiples of $$100$$.
Extending this to consider squares of these values with added multiples of $$1000$$, we find that these give squares ending in $$\{1444, 3444, 5444, 7444, 9444\}$$ - that is, there are no squares that end with $$4$$ similar non-zero digits.
This gives $$k=3$$.
• It's also easy to show that $x^2 \equiv (500-x)^2 \equiv (500+x)^2 \equiv (1000-x)^2 \bmod 1000$, meaning that only values up to $250$ need to be checked, with the other possibilities inferred from the above, in the first step above for three similar digits. A corresponding argument also applies to the search for four similar digits. Nov 26 '21 at 6:42