9.2. Vasya swapped the digits of a three-digit number $A$ so that no digit of the new three-digit number $B$ coincided with the digit of number $\mathrm{A}$ in the same place. It turned out that the difference $A-B$ is a two-digit number, which is a perfect square. What can the number $A$ be? Find all possible options.
Answer. There are 20 solutions in total: $A=218,329, A=213, . ., 879, A=706,817,928, A=201,312, . ., 978$.

Solution. Let $A=\overline{a b c}$, where $a, b, c$ are the digits of its hundreds, tens, and units respectively. From the pigeonhole principle and the condition, it follows that all of them are distinct, as it is impossible to place a minimum of 4 rabbits (two pairs of identical digits in A and B) into 3 cells (digits), so that each gets a separate home. According to the condition, either $B=\overline{b c a}$ or $B=\overline{c a b}$.

Moreover, the difference between A and B is a two-digit number, so the first digit of A is greater than the first digit of B by 1 (as we noticed, the first digits of these numbers cannot be equal).

Let's consider both cases.

1) $B=\overline{b c a}$. Then $A-B=\overline{a b c}-\overline{b c a}=99 a-90 b-9 c$ is a two-digit number, divisible by 9 and a perfect square, i.e., 36 or 81. In the first case, $11 a-10 b-c=4$ and $a=b+1$, so $b+7=c$, from which $b=1,2$ and $A=218,329$ - two solutions. In the second case, $11 a-10 b-c=9$ and $a=b+1$, so $b+2=c$, from which $b=1,2, . ., 7$ and $A=213, \ldots, 879$ - seven solutions.
2) $B=\overline{c a b}$. Then $A-B=\overline{a b c}-\overline{c a b}=90 a+9 b-99 c$ is a two-digit number, divisible by 9 and a perfect square, i.e., 36 or 81. In the first case, $10 a+b-11 c=4$ and $a=c+1$, then $c=b+6, a=b+7$, from which $b=0,1,2$ and $A=706,817,928$ - three solutions. In the second case, $10 a+b-11 c=9$ and $a=c+1$, so $c=b+1, a=b+2$, from which $b=0,1,2, . .7$ and $A=201,312, . ., 978$ - eight solutions. The total number of solutions is $2+7+3+8=20$.

Grading Criteria. ($\cdot$) Only one of the cases for the difference of 36 or 81 is fully considered: 3 points. ($\cdot$) Part of the solutions in one of these cases is not considered: 1 point is deducted in each case.