Proving that a number with digits 1...9 in some order, ending in 5, is not a perfect square.

If "x" is a 9 digit number , which contains digits from 1 to 9 which ends in 5 . Prove that it can't be a perfect square ( digits are not to be repeated).

Please suggest the solution of this question.


Solution 1:

Assume on the contrary that there is a $9$ digit number containing all digits from $1$ to $9$ and ending in $5$ which is a perfect square $m^2$.

Then clearly $m^2$ is odd and divisible by $5$, so $m$ is odd and divisible by $5$. $\frac{m}{5}$ is an integer, so $(\frac{m}{5})^2 \equiv 0, 1, 4 \pmod{5}$. Thus $m^2 \equiv 0, 25, 100 \pmod{125}$. Also $m^2 \equiv 1 \pmod{8}$, so combining gives $m^2 \equiv 625, 025, 225 \pmod{1000}$. Clearly $m^2$ cannot end with $025$ or $225$, so $m^2$ ends with $625$. This implies that $125 \mid m^2$, so $25 \mid m$, so $625 \mid m^2$. Now $m^2 \equiv 625 \pmod{5000}$, so $m^2 \equiv 0625, 5625 \pmod{10000}$, a contradiction.

Therefore a $9$ digit number containing all digits from $1$ to $9$ and ending in $5$ cannot be a perfect square.