Given an integer d, is there a way of finding max(n^m), where d=n\*m, except brute-forcing it ?
n and m don't have to be primes.


For example:


The number 12 can be factorized into two factors as: 1\*12, 2\*6, 3\*4, 4\*3, 6\*2 and 12\*1.
Raising the first factor to the second gives: 1, 64, 81, 64, 36 and 12.
The maximum value is 81.



How can an integer be factorized as n*m so that n^m has the highest value. 
If $n$ is divisible by three than the required split is $(3,n/3)$. If $n$ is not divisible by 3 then the required split is $(p,n/p)$ where $p$ is the smallest prime divisor of $n$.


