Show that the last two decimal digits of a perfect square must be one of the following pairs:
$00, e1, e4, 25, o6, e9$ ($e$ stand for even digit, $o$ for odd).
Solution is given, but I don't understand it at all.
Best Answer
First observe that it suffices to check the integers from $0$ to $99$ as $(100x+y)^2 \equiv y^2 \pmod{100}$. Now, we consider $y \ge 50$. In that case,
$y = 50 +n$, where $0 \le n \le 49$. In that case,
$$y^2 = (50+n)^2 = 2500 + 100n + n^2 \equiv n^2 \pmod{100}.$$
Therefore, the numbers $n$ and $50+n$ share the same last two digits (check, for example, $n=0,1,2$ etc.). As a consequence, we do not need to check the last two digits of the numbers greater than $49$. Rather, we focus on the numbers $0, 1, \cdots , 49$.
Among them, we now consider $y \ge 25$. These numbers can be written as $y = 50-n$ for $0 \le n \le 25$. But
$$y^2 = (50-n)^2 = 2500 - 100n + n^2 \equiv n^2 \pmod{100}.$$
Therefore, the numbers $n$ and $50-n$ share the same last two digits (check, for example, $n=1,2$ etc.; i.e. $1^2$ and $49^2$ have the same last two digits). As a consequence, we do not need to check the last two digits of the numbers greater than $25$. Rather, we focus on the numbers $0, 1, \cdots , 25$.
For $0 \le n \le 25$, we compute their squares and observe the pattern of the last two digits. The pattern turns out to be $00, e1, e4, 25, o6, e9$.
Since the tens digit obviously doesn't matter for what the one digit is, these are all the ways that a square can end.
For the question about an even tens digit, just square $(\sum a_i 10^i)^2=a_0^2+2a_0a_1\cdot 10+\cdots$ You have an even number in front of the $10$, which switches to odd when $a_0^2$ has an odd tens digit. For the question about ending in a $5$ causing the $10$'s digit to be a $2$, notice that if $a_0=5$, then the first term is $25$ and the second is $100a_1$ which doesn't effect the tens spot.
Taking the last two digits of a number is equivalent to taking the number $\bmod 100$. You can write a large number as $100a+10b+c$ where $b$ and $c$ are the last two digits and $a$ is everything else. Then $(100a+10b+c)^2=10000a^2+2000ab+200ac+100b^2+20bc+c^2$. The first four terms all have a factor $100$ and cannot contribute to the last two digits of the square. The term $20bc$ can only contribute an even number to the tens place, so cannot change the result. To have the last digit of the square odd we must have $c$ odd. We then only have to look at the squares of the odd digits to see if we can find one that squares to two odd digits. If we check the five of them, none do and we are done.
Best Answer
First observe that it suffices to check the integers from $0$ to $99$ as $(100x+y)^2 \equiv y^2 \pmod{100}$. Now, we consider $y \ge 50$. In that case, $y = 50 +n$, where $0 \le n \le 49$. In that case, $$y^2 = (50+n)^2 = 2500 + 100n + n^2 \equiv n^2 \pmod{100}.$$ Therefore, the numbers $n$ and $50+n$ share the same last two digits (check, for example, $n=0,1,2$ etc.). As a consequence, we do not need to check the last two digits of the numbers greater than $49$. Rather, we focus on the numbers $0, 1, \cdots , 49$.
Among them, we now consider $y \ge 25$. These numbers can be written as $y = 50-n$ for $0 \le n \le 25$. But $$y^2 = (50-n)^2 = 2500 - 100n + n^2 \equiv n^2 \pmod{100}.$$ Therefore, the numbers $n$ and $50-n$ share the same last two digits (check, for example, $n=1,2$ etc.; i.e. $1^2$ and $49^2$ have the same last two digits). As a consequence, we do not need to check the last two digits of the numbers greater than $25$. Rather, we focus on the numbers $0, 1, \cdots , 25$.
For $0 \le n \le 25$, we compute their squares and observe the pattern of the last two digits. The pattern turns out to be $00, e1, e4, 25, o6, e9$.