Squares Ending in Repeated Digits

From ProofWiki
Jump to navigation Jump to search

Theorem

A square number $n^2$ can end in a repeated digit if and only if either:

$(1): \quad n^2$ is a multiple of $100$, in which case $n$ is a multiple of $10$
$(2): \quad n^2$ ends in $44$ and $n$ ends in $12, 38, 62$ or $88$.


Proof

Let $n \in \Z_{>0}$ end in $a b$.

By the Basis Representation Theorem, $n$ can be expressed as:

$n = 100 k + 10 a + b$

for some $k \in \Z_{>0}$ and for $0 \le a < 10, 0 \le b < 10$.


Then:

\(\ds n^2\) \(=\) \(\ds \paren {100k + 10 a + b}^2\)
\(\ds \) \(=\) \(\ds 100^2 k^2 + 2000 k a + 200 k b + 100 b^2 + 20 a b + b^2\)
\(\ds \) \(\equiv\) \(\ds 20 a b + b^2\) \(\ds \pmod {100}\)

Thus the nature of the last $2$ digits of $n^2$ are not dependent upon $k$.

So we can ignore all digits of $n$ except the last $2$.


Note that if $b = 0$ we have that $b^2 = 0$ and $20 a b = 0$.

So the last $2$ digits of the square of a multiple of $10$ are both $0$, and $n^2$ is a multiple of $100$.


Let $a = 5 + c$ where $0 \le c < 5$.

We have that:

\(\ds \paren {10 a + b}^2\) \(=\) \(\ds \paren {10 \paren {5 + c} + b}^2\)
\(\ds \) \(=\) \(\ds \paren {10 c + 50 + b}^2\)
\(\ds \) \(=\) \(\ds 100 c^2 + 2 \times 500 c + 2 \times 10 b c + 2 \times 50 b + b^2\)
\(\ds \) \(=\) \(\ds 100 c^2 + 1000 c + 100 b + 20 b c + b^2\)
\(\ds \) \(=\) \(\ds 1000 c + 100 b + \paren {10 c + b}^2\)
\(\ds \) \(\equiv\) \(\ds \paren {10 c + b}^2\) \(\ds \pmod {100}\)


So the square of a number ending in $c b$, where $0 \le c < 5$, ends in the same $2$ digits as the square a number ending in $a b$ where $a = c + 5$.


It remains to list the integers from $1$ to $49$, generating their squares and investigating their last $2$ digits:

\(\ds 01^2\) \(=\) \(\ds 01\)
\(\ds 02^2\) \(=\) \(\ds 04\)
\(\ds 03^2\) \(=\) \(\ds 09\)
\(\ds 04^2\) \(=\) \(\ds 16\)
\(\ds 05^2\) \(=\) \(\ds 25\)
\(\ds 06^2\) \(=\) \(\ds 36\)
\(\ds 07^2\) \(=\) \(\ds 49\)
\(\ds 08^2\) \(=\) \(\ds 64\)
\(\ds 09^2\) \(=\) \(\ds 81\)


\(\ds 11^2\) \(=\) \(\ds 121\)
\(\ds 12^2\) \(=\) \(\ds 144\) $n^2$ ends in $44$ and $n$ ends in $12$
\(\ds 13^2\) \(=\) \(\ds 169\)
\(\ds 14^2\) \(=\) \(\ds 196\)
\(\ds 15^2\) \(=\) \(\ds 225\)
\(\ds 16^2\) \(=\) \(\ds 256\)
\(\ds 17^2\) \(=\) \(\ds 289\)
\(\ds 18^2\) \(=\) \(\ds 324\)
\(\ds 19^2\) \(=\) \(\ds 361\)


\(\ds 21^2\) \(=\) \(\ds 441\)
\(\ds 22^2\) \(=\) \(\ds 484\)
\(\ds 23^2\) \(=\) \(\ds 529\)
\(\ds 24^2\) \(=\) \(\ds 576\)
\(\ds 25^2\) \(=\) \(\ds 225\)
\(\ds 26^2\) \(=\) \(\ds 676\)
\(\ds 27^2\) \(=\) \(\ds 729\)
\(\ds 28^2\) \(=\) \(\ds 784\)
\(\ds 29^2\) \(=\) \(\ds 841\)


\(\ds 31^2\) \(=\) \(\ds 961\)
\(\ds 32^2\) \(=\) \(\ds 1024\)
\(\ds 33^2\) \(=\) \(\ds 1089\)
\(\ds 34^2\) \(=\) \(\ds 1156\)
\(\ds 35^2\) \(=\) \(\ds 1225\)
\(\ds 36^2\) \(=\) \(\ds 1296\)
\(\ds 37^2\) \(=\) \(\ds 1369\)
\(\ds 38^2\) \(=\) \(\ds 1444\) $n^2$ ends in $44$ and $n$ ends in $38$
\(\ds 39^2\) \(=\) \(\ds 1521\)


\(\ds 41^2\) \(=\) \(\ds 1681\)
\(\ds 42^2\) \(=\) \(\ds 1764\)
\(\ds 43^2\) \(=\) \(\ds 1849\)
\(\ds 44^2\) \(=\) \(\ds 1936\)
\(\ds 45^2\) \(=\) \(\ds 2025\)
\(\ds 46^2\) \(=\) \(\ds 2116\)
\(\ds 47^2\) \(=\) \(\ds 2209\)
\(\ds 48^2\) \(=\) \(\ds 2304\)
\(\ds 49^2\) \(=\) \(\ds 2401\)


It is seen that the only $n^2$ ending in a repeated digit end in $44$.

The corresponding $n$ are seen to be $12$ and $38$.

Adding $5$ to the $10$s digit of each gives us $62$ and $88$ as further such:

\(\ds 62^2\) \(=\) \(\ds 3844\)
\(\ds 88^2\) \(=\) \(\ds 7744\)

The result follows.

$\blacksquare$


Sources