# Expressing any given number in the form of $x^y + y^x$

I was told by one of my friends that any given positive integer can be expressed in the form of $x^y + y^x$ where x & y are integers.

For example: 17 = $2^3+3^2$

Surprisingly,this could be done for any number. Now he gave me some another number (like 23421) and asked me to find out the values of x & y.

I racked my brain but couldn't get it. Can any one please explain, how is this possible and how to get the values of x & y

-
$23420^1+1^{23420}$. The example was designed to mislead. – André Nicolas Sep 9 '11 at 9:53
@André : turn your comment into an answer! You Rock! – Arjang Sep 9 '11 at 10:36
@André Nicolas: Yeah! I figured that out just 10min after I posted this question. It made me feel stupid. But I didn't delete this questions because, I was hoping some one would prove that it is not possible for any value other than 1 – claws Sep 12 '11 at 4:38
@claws: As the $2^3+3^2$ example shows, some positive integers can be expressed non-trivially as $x^y+y^x$. But such $n$ are "rare." It might be interesting to know whether some $n$ can be expressed in more than two ways. – André Nicolas Sep 12 '11 at 4:52
Wow, a surprisingly easy problem with a surprisingly trivial answer, right? – Simple Art Feb 5 at 0:38


The joke is that if $x > 1$ and $y > 1$ the set of integers of the form $x^y + y^x$ has density zero, so that most numbers are not expressible, while if $x=1$ is allowed the problem is trivial. Hence the misdirection.
@claws: it means that of the integers from 1 to $n$ for large enough $n$, nearly 100 percent are non-expressible, and in the limit where $n$ is "infinitely large" or "tends to infinity", the fraction of non-expressibles is 100 percent. ( en.wikipedia.org/wiki/Natural_density ). The number of expressible integers less than $n$ is approximately $\sqrt{n}$, so that the density of expressibles in [1,n] is about $1/\sqrt{n}$, which approaches zero as $n$ increases. – zyx Sep 11 '11 at 17:58
$n=(n-1)^{1} + 1^{n-1}$, for those (elementary folks) like myself who would like it spelled out. – raxacoricofallapatorius Sep 17 '11 at 2:48