a) A calculator from the country of Cincolândia has only the digits from 0 to 9 and two buttons $\square$ and $\triangle$. The button $\square$ squares the number on the display of the calculator. The button $\triangle$ subtracts 5 from the number on the display of the calculator. Mônica types the number 7 and then presses $\square$ and, subsequently, presses the button $\triangle$. What is the result shown by the calculator?

b) Show that if a natural number $x$ leaves a remainder of 4 when divided by 5, then the number $x^{2}$ leaves a remainder of 1 when divided by 5.

c) On the calculator of Cincolândia, is it possible to type the number 9 and then reach the result 7 by pressing the buttons $\square$ or $\triangle$ in an appropriate manner?
Solution

a) Mônica starts by typing the number 7. Then,

$$
7 \xrightarrow{\square} 7^{2}=49 \xrightarrow{\triangle} 49-5=44 .
$$

Therefore, the final result that appears on the calculator is the number 44.

b) If a natural number $x$ leaves a remainder of 4 when divided by 5, this means that $x$ is of the form

$$
x=5 q+4
$$

where $q$ is a natural number. Squaring it, we get

$$
\begin{aligned}
x^{2} & =(5 q+4)^{2} \\
& =25 q^{2}+2 \cdot 5 q \cdot 4+4^{2} \\
& =5\left(5 q^{2}+8 q\right)+16 \\
& =5\left(5 q^{2}+8 q\right)+15+1 \\
& =5\left(5 q^{2}+8 q+3\right)+1
\end{aligned}
$$

which means that $x^{2}$ leaves a remainder of 1 when divided by 5.

c) The number 9 leaves a remainder of 4 when divided by 5, since $9=5 \cdot 1+4$. The number 7 leaves a remainder of 2 when divided by 5, since $7=5 \cdot 1+2$.

Observe that if a number leaves a remainder of 1 when divided by 5, its square also leaves a remainder of 1 when divided by 5. Indeed, let $x$ be a number that leaves a remainder of 1 when divided by 5. Then, $x=5 q+1$. Therefore,

$$
\begin{aligned}
x^{2} & =(5 q+1)^{2} \\
& =25 q^{2}+2 \cdot 5 q \cdot 1+1^{2} \\
& =5\left(5 q^{2}+2 q\right)+1
\end{aligned}
$$

which shows that $x^{2}$ also leaves a remainder of 1 when divided by 5.

Starting with the number 9 on the calculator screen. If we press the $\square$ key, the result will leave a remainder of 1 when divided by 5, as shown in the previous item. If we press the $\triangle$ key, the result will continue to leave a remainder of 4 when divided by 5, because subtracting 5 does not change the remainder when divided by 5. If at any point the remainder is 1, it will remain 1 forever, as neither of the two operations $\square$ or $\triangle$ will change the remainder when divided by 5.

Thus, starting with 9, the remainder when divided by 5 will always be 4 or 1. Since 7 leaves a remainder of 2 when divided by 5, it is not possible to obtain it!