<s>[INST] Prove that $a \equiv b \pmod{1008}$ 
Suppose that the positive integers $a$ and $b$ satisfy the equation $$a^b-b^a = 1008.$$ Prove that $a \equiv b \pmod{1008}$.

Taking the equation modulo $1008$ we get $a^b \equiv b^a \pmod{1008}$, but I didn't see how to use this to get that $a \equiv b \pmod{1008}$.
 [/INST] We have $1008 = 2^4 \cdot 3^2 \cdot 7$. First note that $a \equiv b \pmod{2}$ since $1008$ is even. Note that $2 \nmid a,b$ since if $2 \mid a,b$ then $a,b \leq 5$. Therefore, $a^b \equiv a \pmod{8}$ and $b^a \equiv b \pmod{8}$, so $a \equiv b \pmod{8}$. Then since $a^4 \equiv 1 \pmod{16}$, we have $a^b \equiv a^a \pmod{16}$ and so $a^a \equiv b^a \pmod{16}$. If $a \equiv 1 \pmod{4}$, then $a \equiv b \pmod{16}$. If $a \equiv 3 \pmod{4}$, then $a^3 \equiv b^3 \pmod{16}$ gives $a \equiv b \pmod{16}$.
We have $a^b \equiv a \pmod{3}$ and $b^a \equiv b \pmod{3}$ since $a$ and $b$ are both odd. Thus $a \equiv b \pmod{3}$. If $a \equiv b \equiv 1 \pmod{6}$, then $a^b \equiv a \pmod{9}$ and $b^a \equiv b \pmod{9}$ by Euler's Totient Theorem since $\varphi(9) = 6$. Thus $a \equiv b \pmod{9}$ in this case. If $a \equiv b \equiv 5 \pmod{6}$, then $a^b \equiv a^5 \pmod{9}$ and $a^5 \equiv b^5 \pmod{9}$. Thus $a \equiv b \pmod{9}$.
Similarly since $\varphi(7) = 6$ we get taking the cases $a \equiv b \equiv 1 \pmod{6}$ and $a \equiv b \equiv 5 \pmod{6}$ again that $a \equiv b \pmod{7}$.
</s>