Prove that a square of a positive integer cannot end with $4$ same digits different from $0$

1k Views Asked by At

Prove that a square of a positive integer cannot end with $4$ same digits different from $0$.

I already proved that square of positive integer cannot end with none of digits $1,2,3,5,6,7,8,9$ using the remainder of division by $3,4,8,10$. Now problem is how to prove that this number cannot end with $4444$.

1

There are 1 best solutions below

1
On

Assume that a number $x\in \mathbb N$ suffices $x^2\mod 10000 = 4444$. Notice that only the 4 least significat digits of $x$ are important for computing $x^2\mod 10000$, so denote by $a,b,c,d$ digits such that: $$x\mod 10000 = 1000a+100b+10c+d$$

Next, notice that: $$x^2 \mod 10000 = 1000(2ad+2bc)+100(2bd+c^2)+10(2cd)+d^2 \mod 10000$$

This gives us a set of equations: $$\begin{cases} d^2 = 4 \\ 2cd = 4\\ 2bd + c^2 = 4\\ 2ad+2bc = 4\\ \end{cases} $$

Since there is no solution for this equation set (for $a,b,c,d\in\{0,1,\ldots,9\}$), no such integer $x$ exists.