C2. A square-stick number is a number you get by placing two or more squares of each two digits next to each other. (A two-digit number cannot start with a 0.) Because, for example, 16 and 25 are squares, 1625 is a square-stick number.

(a) Determine all four-digit square-stick numbers where the first and fourth digits are the same.

(b) Determine all six-digit square-stick numbers that are themselves squares.
C2. (a) The squares of two digits are 16, 25, 36, 49, 64, and 81. We will go through the possibilities per starting and ending digit.

There is no two-digit number in the list that ends with a 2, 3, 7, or 8. Also, there is no two-digit number in the list that starts with a 5 or 9. Therefore, we only need to consider the starting and ending digits 1, 4, and 6.

For the starting and ending digit 1, we see that we must start with the square 16 and end with 81. This gives us 1681. For the starting and ending digit 4, we see that we must start with 49 and end with 64. This gives 4964. For the starting and ending digit 6, we see that we must start with 64 and end with 16 or 36. This gives 6416 and 6436.

Thus, there are four square-sticker numbers where the first and fourth digits are the same, namely 1681, 4964, 6416, and 6436.

(b) Let $K$ be a six-digit square-sticker number, say $K=\overline{a b c d e f}$, where $a, b, c, d$, $e$, and $f$ are the six digits of $K$. That $K$ is a square-sticker number means that $\overline{a b}$, $\overline{c d}$, and $\overline{e f}$ are each two-digit squares, i.e., equal to 16, 25, 36, 49, 64, or 81. We want $K$ to be a square, say $K=n^{2}$. We determine the solutions for each possibility of $\overline{a b}$.

$\overline{a b}=16$ Since $K>160000$, it must be that $n>400$. Write $n=400+x$ with $x$ a positive integer. It holds that $K=(400+x)^{2}=160000+800 x+x^{2}$. Since $K<170000$, it must be that $800 x<10000$ and thus $x \leqslant 12$.

Note that the last two digits $\overline{\text { ef }}$ of $K=160000+800 x+x^{2}$ are the same as the last two digits of $x^{2}$. Since the last two digits of $10^{2}=100,11^{2}=121$, and $12^{2}=144$ do not form a square, the possibilities $x=10,11,12$ are eliminated. Since $1^{2}=1,2^{2}=4$, and $3^{2}=9$ are single digits, the possibilities $x=1,2,3$ are also eliminated.

We now examine the remaining cases $x=4,5,6,7,8,9$. In these cases, $x^{2}$ is a two-digit number, and we find that $\overline{c d}=8 \cdot x$. Only in the case $x=8$ is this a square. This gives one solution, namely $408^{2}=166464$.

$\overline{a b}=25$ Analogous to the previous case, we can now write $n=500+x$ with $x$ a positive integer. It holds that $K=(500+x)^{2}=250000+1000 x+x^{2}$. Since $K<260000$, it must be that $1000 x<10000$ and thus $x \leqslant 9$.

We see that for every possible choice of $x$, the digit $d$ is equal to 0. There are thus no solutions.

$\overline{a b}=36$ We write $n=600+x$ with $x$ a positive integer. It holds that $K=(600+x)^{2}=360000+1200 x+x^{2}$. Since $K<370000$, it follows that $1200 x<10000$ and thus $x \leqslant 8$. Also, it must be that $x \geqslant 4$ because otherwise the digit $e$ is equal to 0.

For the remaining candidates $x=4,5,6,7,8$, we find that $\overline{c d}=12 \cdot x$. However, this is not a square for any of the possible choices of $x$. There are thus no solutions.

$\overline{a b}=49$ We write $n=700+x$ with $x$ a positive number. It holds that $K=(700+x)^{2}=490000+1400 x+x^{2}$. Since $K<500000$, it follows that $1400 x<10000$ and thus $x \leqslant 7$. Just as in the previous case, it also holds that $x \geqslant 4$ because the digit $e$ must not be 0. For the remaining candidates $x=4,5,6,7$, we find that $\overline{c d}=14 \cdot x$ is not a square. There are thus no solutions.

$\overline{a b}=64$ We write $n=800+x$ with $x$ a positive number. It holds that $K=(800+x)^{2}=640000+1600 x+x^{2}$. Since $K<650000$, it follows that $1600 x<10000$ and thus $x \leqslant 6$. It also holds again that $x \geqslant 4$.

For the remaining candidates $x=4,5,6$, $\overline{c d}=16 \cdot x$ is only a square when $x=4$. This gives the solution $804^{2}=646416$.

$\overline{a b}=81$ We write $n=900+x$ with $x$ a positive number. It holds that $K=(900+x)^{2}=810000+1800 x+x^{2}$. Since $K<820000$, it follows that $1800 x<10000$ and thus $x \leqslant 5$. It also holds again that $x \geqslant 4$.

For the remaining candidates $x=4,5$, we find that $\overline{c d}=18 \cdot x$ is not a square. There are thus no solutions.

We conclude that there are in total two six-digit square-sticker numbers that are themselves squares, namely 166464 and 646416.