TITLE: Easy highschool number theory equation
QUESTION [5 upvotes]: 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$.

REPLY [7 votes]: 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$,

$x^y-y^x$ will be negative for $y<x$ (So no solutions are possible with $y<x$.)
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$.
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.