## T-7 N

Find all pairs of positive integers $(a, b)$ such that

$$
a!+b!=a^{b}+b^{a}
$$

Answer. $(a, b) \in\{(1,1),(1,2),(2,1)\}$


Solution. If $a=b$, the equation reduces to $a!=a^{a}$. Since $a^{a}>a!$ for $a \geqslant 2$, the only solution in this case is $a=b=1$. If $a=1$, the equation reduces to $b!=b$, which gives an additional solution $a=1, b=2$. We prove $a=b=1 ; a=1, b=2$ and $a=2, b=1$ are the only solution of the Diophantine equation.

Assume $a, b$ is another solution satisfying $1a$ we have $p \left\lvert\, \frac{b!}{a!}\right.$ and hence, $\frac{b!}{a!}+1$ is coprime to $p$. Thus, the exponent in prime factorization of LHS equals the exponent of $p$ in prime factorization of $a$ !. It is well know, that this equals

$$
\sum_{k=1}^{\infty}\left\lfloor\frac{a}{p^{k}}\right\rfloor=\left\lfloor\frac{a}{p}\right\rfloor+\left\lfloor\frac{a}{p^{2}}\right\rfloor+\left\lfloor\frac{a}{p^{3}}\right\rfloor+\ldots
$$

We have $\sum_{k=1}^{\infty}\left|\frac{a}{p^{k}}\right|a$. This contradicts the assumption that $a, b$ is a solution. Therefore there are no solutions to the equation, when $a, b \geqslant 2$.

