Identities of the form $397612 = 3^2+9^1+7^6+6^7+1^9+2^3$ Consider the interesting equality: 
$$397612 = 3^2+9^1+7^6+6^7+1^9+2^3$$
Is there any criterion for an integer number $\displaystyle m$ to satisfy the equality 
$$m=a_1+a_2\times 10^1+...+a_{n-1}\times 10^{n-2}+a_{n}\times 10^{n-1}=a_1^{a_n}+\cdots+a_{n}^{a_1}\quad?$$ 
We assume that $0 \leq a_i \leq 9$ for every $1 \leq i \leq n$ and that $a_n \geq 1$.
 A: A quick Java program reveals the numbers:


*

*$1$

*$48625$

*$397612$


are the only such numbers which are less than $10^8$. This is not by any means a full answer, but it's a good start. This took a couple minutes to run, so using it to check for higher powers of $n$ isn't viable. Let me know if you have improvements for the code.
My code is below.
import java.util.Arrays;
class WeirdNumberTest
{
  public static void main(String args[])
  {
    for (int number = 1; number < 100000000; number++)
    {
      int[] digits = getDigits(number);
      int sum = 0;
      int n = digits.length;
      for (int i = 0; i < n; i++)
      {
        sum += Math.pow(digits[i], digits[n-1-i]);
      }
      if (number == sum) System.out.println(sum);
    }
  }

  public static int[] getDigits(int n)
  {
    int nbrDigits = 0;
    int currentNbr = n;
    while (currentNbr != 0)
    {
      currentNbr = currentNbr/10;
      nbrDigits++;
    }
    int[] digitArray = new int[nbrDigits];
    currentNbr = n;
    for (int i = 0; i < nbrDigits; i++)
    {
      digitArray[i] = currentNbr%10;
      currentNbr = currentNbr/10;
    }
    return digitArray;
  }
}

A: Not quite the same form, but I like $2^59^2 = 2592$.
