Prime Power Switch
Input: A positive integer n=p^q where p and q are prime.
Output: Output the result of q^p
Test cases (in, out):
4, 4 8, 9 25, 32 27, 27 49, 128 121, 2048 125, 243 343, 2187 1331, 177147 3125, 3125, 16807, 78125, 823543, 823543 161051, 48828125 19487171, 1977326743 Mathematica Example Implementation
Power@@Reverse@Flatten@FactorInteger[#]&; Scoring:
This is code-golf, so may the shortest code in bytes win!