## Task A-4.1.

Determine all numbers $a, b \in \mathbb{N}_{0}$ and $n \in \mathbb{N}$ for which

$$
2^{a}+3^{b}+1=n!
$$
## Solution.

The only solutions to this equation are $(a, b, n)=(1,1,3),(2,0,3)$.

If $n \leqslant 2$, the right-hand side of the equation is smaller than the left, so there are no solutions. If $n=3$, it is necessary that $b=0$ or $b=1$. In both cases, we find the solutions: $(2,0,3),(1,1,3)$.

1 point

We now assume that $n \geqslant 4$.

Since the right-hand side of the equation is even, the left-hand side must also be even, which is only the case if $a \geqslant 1$.

1 point

Consider the remainders that the expressions in the equation give when divided by 8. For $n \geqslant 4$, $n$! is divisible by 8, while the expression $3^{b}$ gives remainders of 3 or 1. If $a \geqslant 3$, then the left-hand side of the equation would give a remainder of 2 or 4, leading to a contradiction. Therefore, it must be that $a \leqslant 2$.

Thus, we have two cases: $a=1$ or $a=2$.

In the case $a=1$, the equation becomes $3^{b}+3=n$!. By direct verification, we see that the equation has no solutions for $n=4$ and $n=5$. For $n \geqslant 6$, consider the remainders that the expressions in the equation give when divided by 9. For $b=0$ and $b=1$, we do not get solutions, while for $b \geqslant 2$, the left-hand side of the equation gives a remainder of 3 when divided by 9. Since the right-hand side of the equation is divisible by 9, we reach a contradiction, so there are no solutions in this case.

In the case $a=2$, the equation becomes $3^{b}+5=n$!. For $b=0$, we do not get a solution, and for $b \geqslant 1$, all expressions except 5 are divisible by 3, so we do not get solutions in this case either.

1 point

Having considered all cases, we conclude that $(a, b, n)=(1,1,3),(2,0,3)$ are indeed the only solutions to this equation.