NumberTheory ProofByContradiction Difficult

Problem - 3930
Find all pairs of positive integers $(a, b)$ satisfying $a! + b! = a^b + b^a$.

If $a=b$, the equation reduces to $a! = a^a$. Because $a! < a^a$ holds for all $a \ge 2$, therefore there is only one solution in this case: $a=b=1$. When $a=1$, the given equation reduces to $b!=b$ which gives an additional solution $(a, b)=(1, 2)$, By symmetry, $(a, b)=(2, 1)$ is a solution too. Now let's prove these three pairs are only solutions using proof by contradiction. If there exists an additional solution, then $a$ and $b$ must not be equal and both of them are greater than $1$. Without loss of generality, let's assume $1 < a < b$. It is easy to see $b!$ will be a multiple of $a$ as a result because $$b! = 1\cdot 2\cdots a \cdot (a+1) \cdots b \implies a \mid b!$$ Then, three terms in the relation $a!+b!=a^b + b^a$ are multiples of $a$. It must be true that the last term $b^a$ must be a multiple of $a$ too, i.e., $a\mid b^a$. Let $p$ be any prime factor of $a$, then $p \mid b^a$ because $a$ is a multiple of $p$ and $b^a$ is a multiple of $a$. It follows that $p$ must divide $b$ due to the fact that $p$ is prime. Next, we are going to examine the exponent of $p$ of both sides of the given equation. \begin{equation} a!+b! = a^b + b^a \implies a!\Big(1+\frac{b!}{a!}\Big)=a^b + b^a\quad\quad (1) \end{equation} On its left, we claim that $\Big(1+\frac{b!}{a!}\Big)$ is not a multiple of $p$. This is because $p\mid b \implies p\mid\frac{b!}{a!}=(a+1)\cdots b$, hence $p$ cannot divide $\Big(1+\frac{b!}{a!}\Big)$. Therefore, the exponent of $p$ in the left side's prime factorization equals that of $a!$'s prime factorization. It is well known by basic number theory that this exponent equals \begin{equation} \Big\lfloor\frac{a}{p}\Big\rfloor+\Big\lfloor\frac{a}{p^2}\Big\rfloor+\Big\lfloor\frac{a}{p^3}\Big\rfloor+\cdots\quad\quad (2) \end{equation} where the flooring function $\lfloor{x}\rfloor$ returns the largest integer not exceeding $x$. It is clear that $$\Big\lfloor\frac{a}{p}\Big\rfloor+\Big\lfloor\frac{a}{p^2}\Big\rfloor+\Big\lfloor\frac{a}{p^3}\Big\rfloor+\cdots < \frac{a}{p}+\frac{a}{p^2}+\frac{a}{p^3}+\cdots =\frac{a}{p-1}\le a$$ This means that the value of equation (2) is less than $a$. However, on its right, because $a^b + b^a > a^a + a^a=2a^a$, the exponent of $p$ in its prime factorization is at least $a$. Hence, relation (1) cannot hold. This contradiction means the assumption that more solution exists is false. It follows that the given equation has only three solutions $\boxed{(1, 1), (1, 2), (2, 1)}$.

report an error