Solve the following equation in the set of positive integers:

$$
n!=2^{a}+2^{b}
$$
I. Solution. If $n$ is at least 7, then $n$! is divisible by 7. The remainder of the division of powers of 2 by 7 can be 1, 2, or 4, since $2^{0}=\mathbf{1}, 2^{1}=\mathbf{2}, 2^{2}=\mathbf{4}, 2^{3}=8=1 \cdot 7+\mathbf{1}, 2^{4}=2^{3} \cdot 2=(1 \cdot 7+\mathbf{1}) \cdot 2=2 \cdot 7+\mathbf{2}, 2^{5}=2^{4} \cdot 2=(2 \cdot 7+\mathbf{2}) \cdot 2=4 \cdot 7+\mathbf{4}$, etc. However, a sum of two terms $c+d$, where $c, d \in\{1,2,4\}$, is not divisible by 7, so we can only hope for solutions when $n \leq 6$. Among these, only $3!=6=2^{2}+2^{1}$, and $4!=24=2^{4}+2^{3}$ are valid. (Each case provides two solutions, as the roles of $a$ and $b$ can be swapped.)

The solutions are thus:

| $n$ | 3 | 3 | 4 | 4 |
| :---: | :---: | :---: | :---: | :---: |
| $a$ | 1 | 2 | 3 | 4 |
| $b$ | 2 | 1 | 4 | 3 |

II. Solution. Instead of examining the remainders upon division by 7, we can look at the remainders upon division by 15, or the 3 and 5 remainders that uniquely determine them. Clearly, $2^{0} \equiv 1(\bmod 3), 2^{1} \equiv-1(\bmod 3), 2^{2} \equiv 1(\bmod 3)$, etc., and $2^{0} \equiv 1(\bmod 5)$, $2^{1} \equiv 2(\bmod 5), 2^{2} \equiv-1(\bmod 5), 2^{3} \equiv-2(\bmod 5), 2^{4} \equiv 1(\bmod 5)$, etc.; from this, it is clear that $2^{a}+2^{b}$ is divisible by 3 if and only if $a$ and $b$ have different parities, while divisibility by 5 requires that $a$ and $b$ have the same parity. The two conditions cannot be satisfied simultaneously, so $2^{a}+2^{b}=n$! is not divisible by $3 \cdot 5$, meaning only $n \leq 4$ can be considered, from which we obtain the result of the first solution.