Find all pairs of naturals $(a,b)$ such that $a^b-b^a=3$

This question is given in AMTI second level contest.

Find all pairs of naturals $(a,b)$ such that $a^b-b^a=3$.

My try: One such pair is $(4,1)$. Are there any other pairs? Please help me.

• consider $f(x)=x^b-b^x-3$ and use dervative. – hamam_Abdallah Oct 22 '16 at 14:56
• I didn't understand you sir. – sai saandeep Oct 22 '16 at 15:32

Taking mod 2 we can easily see that exactly one of them is even .
Case 1. $a=2m$:
$$(2m)^b-b^{2m}=3$$
If $b\geq3$, $(2m)^b\equiv 0\pmod 8$ so
$$-b^{2m}\equiv 3\pmod 8$$ $$b^{2m}\equiv 5\pmod 8$$ but no square is 5 mod 8,so no solution, so $b=1$
$$2m-1=3$$ $$m=2,a=4$$ Case 1. $b=2m$:
$$(a)^{2m}-(2m)^{a}=3$$
If $a\geq3$, $(2m)^a\equiv 0\pmod 8$ so
$$a^{2m}\equiv 3\pmod 8$$ but no square is 3 mod 8,so no solution, so $a=1$
$$1-2m=3$$ but no natural solution
The only solution is $(4,1)$

• Should use $\ge$ (dollar sign, \ge, dollar sign) instead of >. – Oscar Lanzi Oct 22 '16 at 15:15
• @OscarLanzi yeah now I'll edit, thank you. – arberavdullahu Oct 22 '16 at 15:18