# Easy highschool number theory equation

I have some problems with my homework.

We have two integers $a$ and $b$ which satisfy the equation $a^b - b^a = 1008$.

Show that $a$ and $b$ have the same remainder when divided by $1008$.

-

I don't think this is so easy. It's not true if $1008$ is replaced by, say, $7 = 2^5 - 5^2$ or $28 = 2^6 - 6^2$ or $2800 = 4^6 - 6^4$. Of course one solution is $a=1009$, $b=1$. I don't think there are any solutions with $a,b\ge 2$, based on the fact that $1008$ is not listed in https://oeis.org/A045575 , but I don't know if there's a proof of that.

-
Is there any other solutions? Where can i find some formal proofs abut numbers in x^y - y^x form ? –  John Smith Sep 9 '12 at 21:48

Do you know that $(x_0)^x$ grows faster than $x^{x_0}$ when $x,x_0>e$? Both of these quantities are equal when $x=x_0$. That is, the function $f$ with $f(x,y)=x^y-y^x$ is identically $0$ along $y=x$. But because of this difference in growth rate, when $x,y>e$,

1. $x^y-y^x$ will be negative for $y<x$ (So no solutions are possible with $y<x$.)
2. For $y>x$, $x^y-y^x$ will be much larger than $0$. In particular, for $x\geq5$, we can establish with calculus that $x^y-y^x>1008$ when $y$ is supposed to be a whole number greater than $x$.
3. It would remain to examine $x=4,3,2,1$ separately.

Since this is homework, I am leaving out the calculus details that establish items 1 and 2.

-