10. Given a sequence $\left\{a_{n}\right\}$ with all terms being positive integers, it satisfies: for any positive integers $m, k$ there are $a_{m^{2}}=a_{m}^{2}$ and $a_{m^{2}+k^{2}}=$ $a_{m} a_{k}$, find the general term formula of the sequence $\left\{a_{n}\right\}$.