TITLE: Find integral solution of $a^{b} - b^{a} = 3$
QUESTION [5 upvotes]: Find the integral solution of $$a^b -  b^a = 3$$
I am a student of class 10 and got this question in a maths competetive exam.
I have tried converting into a log equation in one variable, or solve it by using parity but couldn't solve it.
Thanks in advance

REPLY [3 votes]: $a,b$ are of opposite parity,
If $b$ is odd, and $b>1$ we further have $b>a$. Then in the equation $a^b = b^a+3$ has LHS equal to $0$ modulo $8$, while RHS is $4$ modulo $8$.
If $a \ge 3$ is odd, then  in the above equation, LHS and RHS will be $1, 3$ resp. modulo $8$.
The only remaining case is $b=1$, which gives $a=4$.
Hence the only solution is $(4,1)$.