Exercise 10. Find all triplets of positive integers $(x, y, z)$ satisfying the equation

$$
x! + 2^y = z!
$$
## Solution to Exercise 10

Let $(x, y, z)$ be a solution triplet.

First, we aim to reduce the number of values that $x$ can take. Note that $x! < z!$ so $x < z$. In particular, $x!$ divides $z!$ and $x!$, so $x!$ divides $z! - x! = 2^y$. Suppose, for the sake of contradiction, that $x \geq 3$. In this case, 3 divides $x!$ but does not divide $2^y$, which makes it impossible for $x!$ to divide $2^y$. Therefore, $x = 0, 1,$ or $2$.

We now consider two cases: $x! = 1$ (so $x = 0$ or $1$), or $x! = 2$ (so $x = 2$).

- Case $x = 0$ or $1$: The equation becomes $1 + 2^y = z!$. We then consider two sub-cases:
  - Case $y = 0$: We find $z = 2$. Conversely, $(0,0,2)$ and $(1,0,2)$ are indeed solutions.
  - Case $y \geq 1$: Thus, $1 + 2^y \geq 3$ and $1 + 2^y$ is odd. However, $z!$ is even if $z \geq 2$, and equals 0 or 1 if $z = 1$. Neither of these cases can satisfy our equation. Therefore, if we assume $y \geq 1$, there are no solutions.
- Case $x = 2$: We further distinguish according to the values of $y$:
  - Case $y = 0$: We get $3 = z!$ which has no solutions (since $2! < 3 < 3!$).
  - Case $y = 1$: We get $4 = z!$ which has no solutions (since $2! < 3 < 3!$).
  - Case $y \geq 2$: We get that 2 divides $2^y + 2$, but 4 does not divide $2^y + 2$. Thus, 2 divides $z!$ but 4 does not divide $z!$, so $z = 2$ or $3$. Since $2^y + 2 \geq 4 + 2 = 6$, we get $z = 3$, so $2 + 2^y = 6$, thus $2^y = 4$ and $y = 2$. Conversely, $(2,2,3)$ is indeed a solution because $2 + 4 = 6$.

Thus, the solutions are the triplets $(0,0,2)$, $(1,0,2)$, and $(2,2,3)$.

Comment from the graders: Almost all students who attempted the exercise understood it well. However, solving the equation without errors was more challenging: many students forgot some cases (typically the case $x = 0$; it is also worth noting that $0! = 1$), made hasty generalizations (for example, that $1 + 2^{y-1}$ is always odd—this is true only if $y \geq 2$, and the case $y \leq 1$ must be treated), or forgot to verify that the triplets they found were solutions (a common mistake; it is always necessary to do so, even if it only involves saying "we verify conversely that [...] are indeed solutions"). Some students did not justify certain more general arguments ("the only factorials with a difference of 1 are 2 and 1," or "the only factorials that are powers of 2 are 2 and 1"), or did so very vaguely (by talking about "rate of growth," which is not applicable here). Such statements must always be justified (especially since the argument can be made in one or two sentences). Finally, a surprising number of papers contain minor inconsistencies or oversights, generally not penalized: we invite candidates to carefully proofread their papers before submitting them.