2. For every positive integer $a$, the number $d=d(a)$ is obtained through the following process:
(1) Move the last digit of $a$ to the first position to get the number $b$;
(2) Square $b$ to get the number $c$;
(3) Move the first digit of $c$ to the last position to get the number $d$.
For example, if $a=2003$, then $b=3200$, $c=10240000$, and $d=02400001=2400001=d(2003)$.
Find all positive integers $a$ such that $d(a)=a^{2}$.
(USA)
Let the positive integer $a$ satisfy $d=d(a)=a^{2}$, and $a$ has $n+1$ digits, $n \geqslant 0$. Let the last digit of $a$ be $s$, and the first digit of $c$ be $f$. Because
$$
\begin{array}{l}
(* \cdots * s)^{2}=a^{2}=d=* \cdots * f, \\
(s * \cdots *)^{2}=b^{2}=c=f * \cdots *,
\end{array}
$$

where * represents a single digit, so $f$ is both the last digit of the square of a number ending in $s$, and the first digit of the square of a number starting with $s$.

The perfect square $a^{2}=d$ is either a $2n+1$-digit number or a $2n+2$-digit number.

If $s=0$, then $n \neq 0, b$ has $n$ digits, and its square $c$ has at most $2n$ digits. Therefore, $d$ also has at most $2n$ digits, which is a contradiction.
Thus, the last digit of $a$ is not 0.
If $s=4$, then $f=6$. Since the square of a number starting with 4 has a first digit of 1 or 2, i.e.,
$$
\begin{array}{l}
160 \cdots 0=(40 \cdots 0)^{2} \leqslant(4 * \cdots *)^{2} \\
<(50 \cdots 0)^{2}=250 \cdots 0,
\end{array}
$$

so, $s \neq 4$.
Table 1 shows the possible values of $f$ for different values of $s$.
From Table 1, we can see that when $s=1, s=2, s=3$, $f=s^{2}$. When $s=1$ or $s=2$, the square $c=b^{2}$ of an $n+1$-digit number $b$ starting with $s$ is a $2n+1$-digit number; when $s=3$, $c=b^{2}$ is either a $2n+1$-digit number with the first digit 9 or a $2n+2$-digit number with the first digit 1. Since $f=s^{2}=9$, the first digit cannot be 1. Therefore, $c$ must be a $2n+1$-digit number.

Let $a=10x+s$, where $x$ is an $n$-digit number (especially, $x=0$, set $n=0$), then
$$
\begin{array}{l}
b=10^{n} s+x, c=10^{2 n} s^{2}+2 \times 10^{n} s x+x^{2}, \\
d=10\left(c-10^{m-1} f\right)+f \\
=10^{2 n+1} s^{2}+20 \times 10^{n} s x+10 x^{2}-10^{m} f+f,
\end{array}
$$

where $m$ is the number of digits in $c$, and it is known that $m=2n+1, f=s^{2}$. Therefore, $d=20 \times 10^{n} s x+10 x^{2}+s^{2}$.
By solving $a^{2}=d$, we get $x=2 s \cdot \frac{10^{n}-1}{9}$.

Thus, $a=\underbrace{6 \cdots 6}_{n \uparrow} 3, a=\underbrace{4 \cdots 4}_{n \uparrow} 2$ or $a=\underbrace{2 \cdots 2}_{n \uparrow} 1$, where $n \geqslant 0$.
For the first two possible cases, if $n \geqslant 1$, by $a^{2}=d$, we get that $d$ has $2n+2$ digits, indicating that $c$ also has $2n+2$ digits. This contradicts the fact that $c$ has $2n+1$ digits, so $n=0$.
In summary, the numbers $a$ that satisfy the conditions are $a=3, a=2, a=\underbrace{2 \cdots 2}_{n \hat{1}} 1$, where $n \geqslant 0$.