8. Find the smallest odd number $a$ greater than 5 that satisfies the following conditions: there exist positive integers $m_{1}, n_{1}, m_{2}, n_{2}$, such that
$$
a=m_{1}^{2}+n_{1}^{2}, a^{2}=m_{2}^{2}+n_{2}^{2} \text {, }
$$

and $m_{1}-n_{1}=m_{2}-n_{2}$.
8. From $261=15^{2}+6^{2}, 261^{2}=189^{2}+180^{2}$,
$15-6=189-180$,
we know that 261 has the property described in the problem.
Next, we prove that 261 is the smallest odd number greater than 5 with the property described in the problem, i.e., there is no such odd number between 5 and 261.

If not, then there exists an odd number $a$ between 5 and 261 and positive integers $m_{1}, n_{1}, m_{2}, n_{2}$, such that
$a=m_{1}^{2}+n_{1}^{2}, a^{2}=m_{2}^{2}+n_{2}^{2}, m_{1}-n_{1}=m_{2}-n_{2}$.
Let $m_{1}-n_{1}=l$, by symmetry, we can assume $l \geqslant 0$.
Since $a$ is odd, $m_{1}$ and $n_{1}$ have different parities.
Therefore, $l$ is an odd number.
Also, $m_{1}500>261$, a contradiction.
If $l=5$, then $a^{2} \equiv 2 n_{2}^{2}(\bmod 5)$.
Since 2 is not a quadratic residue modulo 5, $51 a$.
Also, $0 \equiv a \equiv 2 n_{1}^{2}(\bmod 5)$, so $5 \mid n_{1}$.
If $n_{1} \geqslant 10$, then $m_{1} \geqslant 15$.
Thus, $a \geqslant 15^{2}+10^{2}=325>261$, a contradiction;
If $n_{1}=5$, then
$m_{1}=10, a=10^{2}+5^{2}=125$.
But from $125^{2}=\left(n_{2}+5\right)^{2}+n_{2}^{2}$, we get
$$
\left(2 n_{2}+5\right)^{2}=5^{2} \times 1249,
$$

a contradiction.
If $l=7$, then by $a<261<16^{2}+9^{2}$, we know $n_{1} \leqslant 8$.
By enumerating $n_{1}$, we find that $a$ can only be
$65,85,109,137,169,205,245$

one of these.
From $a^{2}=\left(n_{2}+7\right)^{2}+n_{2}^{2}$, we get
$\left(2 n_{2}+7\right)^{2}=2 a^{2}-49$.
Therefore, $2 a^{2}-49$ must be a perfect square.
But by verifying each of $a=65,85,109,137,169,205,245$, we find that none of these values of $a$ satisfy the condition.

In conclusion, the smallest odd number greater than 5 with the property described in the problem is 261.
(Provided by Zhu Huawei)