4A. For which digits $a$ and $b(a \neq 0)$ is the number $9(\overline{a b 5}-\overline{a b})(\overline{a b}+1)+4$ a perfect square.
Solution. For any digits $a$ and $b(a \neq 0)$, the number $9(\overline{a b 5}-\overline{a b})(\overline{a b}+1)+4$ can be written in the form

$$
\begin{aligned}
9(\overline{a b 5}-\overline{a b})(\overline{a b}+1)+4 & =9(10 \cdot \overline{a b}+5-\overline{a b})(\overline{a b}+1)+4=9(9 \cdot \overline{a b}+5)(\overline{a b}+1)+4 \\
& =81 \cdot \overline{a b}^{2}+126 \cdot \overline{a b}+49=(9 \cdot \overline{a b}+7)^{2}
\end{aligned}
$$

Thus, for any digits $a$ and $b(a \neq 0)$, the number $9(\overline{a b 5}-\overline{a b})(\overline{a b}+1)+4$ is a perfect square.