There is always a trivial solution: $x=n-1,y=1$.
You can use brute force to find non trivial solutions.
Method 1. Calculate $x^y+y^x$ for all pairs $x < \sqrt{n}$ and $y < \sqrt{n}$. Since we are not interested in trivial solutions, we don't need to check $x > \sqrt{n}$. Then check if we have $n$ in the result list.
findNonTrivialPairs[n_]:=Select[{#1, #2, #1^#2 + #2^#1} & @@@ Tuples[#, 2] &@
Range[Ceiling@Sqrt[n]], #[[3]] == n &];
findNonTrivialPairs[100]
(* {{2, 6, 100}, {6, 2, 100}} *)
AbsoluteTiming@findNonTrivialPairs[94032]
(* {0.545318, {}} <- no non-trivial solutions *)
Method 2.
We will look for pairs where $y > x$, so iterations over y start with $x$
f[{x_, y_, z_}] := {x, y + 1, x^(y + 1) + (y + 1)^x};
g[x_, n_] := NestWhile[f, {x, x, 0}, #[[3]] < n &];
findPairs[n_] :=Select[Map[g[#, n] &,Range[n/2]], #[[1]]^#[[2]] + #[[2]]^#[[1]] == n &];
findPairs[100]
(* {{1, 99, 100}, {2, 6, 100}} it has non-trivial solutions *)
Let's find non-trivial solutions for $100<n<200$
Rest /@ Select[findPairs /@ Range[100, 1000], Length[#] > 1 &]
(* {{{2, 6, 100}}, {{3, 4, 145}}, {{2, 7, 177}}, {{2, 8, 320}}, {{3, 5,
368}}, {{2, 9, 593}}, {{3, 6, 945}}} *)
For your particular $n=94032$ it seems to have no non-trivial solution (and it takes some time to calculate it):
AbsoluteTiming@findPairs[94032]
(* {108.22, {{1, 94031, 94032}}} *)
Update: We don't need to iterate up to n/2
we can iterate up to l
, where l^l=n
It will significantly increase performance.
limit[n_] := Ceiling[x /. FindRoot[x^x == n, {x, 1}]];
findPairs2[n_] :=
Select[Map[g[#, n] &,Range[limit[n]]], #[[1]]^#[[2]] + #[[2]]^#[[1]] == n &];
AbsoluteTiming@findPairs2[94032]
(* {0.401372, {{1, 94031, 94032}}} *)