Let $n$ be an integer. If the tens digit of $n^2$ is 7, what is the units digit of $n^2$

contest-mathelementary-number-theory

Let $n$ be an integer. If the tens digit of $n^2$ is 7, what is the units digit of $n^2$?

So $n^2 \equiv 7 \pmod{100}$? If this is the case then this can be written as $n^2 = 100k +7$, where $k \in \Bbb Z.$

Here one can see that no matter what the choice of $k$, the units digit will be $7$. Thus $n^2 \equiv 7 \pmod{10}.$ However this was wrong. The correct answer is $\textbf{6}.$

What am I doing wrong here? It seems that $n^2 \equiv 7 \pmod{100}$ doesn't hold. If the tens digit is $7$ should I have that $n^2 \equiv 7k \pmod{100}$, where $k$ represents the unit digit of $70$ and not a multiplication?

Best Answer

You are correct that $n^2\equiv7\bmod100$ does not hold, but rather $n^2\equiv70+k$.

To be a square, the last two digits have to have remainder $0$ or $1$ when divided by $4$

and remainder $0, 1, $ or $4$ when divided by $5$.

Look at the numbers from $70$ to $79$, and figure out which one satisfies those

to figure out what the last digit of $n^2$ must be.