Identities of the form $397612 = 3^2+9^1+7^6+6^7+1^9+2^3$

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;
  }
}

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