Problem: Find all pairs $(a,b)$ of positive integers satisfying
\[ a^{b^2} = b^a. \]

Solution: The answer is $(1,1)$, $(16,2)$ and $(27,3)$.

We assume $a,b > 1$ for convenience.
Let $T$ denote the set of non perfect powers other than $1$.
\begin{claim*}
Every integer greater than $1$
is uniquely of the form $t^n$ for some $t \in T$, $n \in \NN$.
\end{claim*}
\begin{proof}
  Clear.
\end{proof}

Let $a = s^m$, $b = t^n$.
\[ s^{m \cdot (t^n)^2} = t^{n \cdot s^m}. \]
Hence $s = t$ and we have
\[ m \cdot t^{2n} = n \cdot t^m
  \implies t^{2n-m} = \frac nm. \]
Let $n = t^e m$ and $2 \cdot t^e m - m = e$, or
\[ e + m = 2t^e \cdot m. \]
We resolve this equation by casework
\begin{itemize}
  \ii If $e > 0$, then $2t^e \cdot m > 2e \cdot m > e+m$.
  \ii If $e=0$ we have $m=n$ and $m = 2m$, contradiction.
  \ii If $e = -1$ we apparently have
  \[ \frac{2}{t} \cdot m = m-1 \implies
    m = \frac{t}{t-2} \]
  so $(t,m) = (3,3)$ or $(t,m) = (4,2)$.
  \ii If $e = -2$ we apparently have
  \[ \frac{2}{t^2} \cdot m = m - 2
    \implies m = \frac{2}{1 - 2/t^2} = \frac{2t^2}{t^2-2}. \]
  This gives $(t,m) = (2,2)$.
  \ii If $e \le -3$ then let $k = -e \ge 3$, so the equation is
  \[ m-k = \frac{2m}{t^k}
  \iff m = \frac{k \cdot t^k}{t^k-2}
    = k + \frac{2k}{t^k-2}. \]
  However, for $k \ge 3$ and $t \ge 2$,
  we always have $2k \le t^k - 2$,
  with equality only when $(t,k) = (2,3)$;
  this means $m=4$, which is not a new solution.
\end{itemize}