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

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

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$, making it impossible for $x!$ to divide $2^y$. Therefore, $x = 0, 1,$ or $2$.

We now perform a case analysis between $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 perform a second case analysis:
  - 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 distinguish further based on 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: The exercise, being rather simple, was approached by a large number of students. Most managed to find the correct set of solutions and thought to use modular arithmetic or divisibility, which is very good. However, many errors were made, consisting of neglecting to properly handle the small cases. For example, many papers hastily claimed that a power of 2 is even, which is false for $2^0 = 1$. Attention should be paid to such details. It is also reminded that 0 is a positive integer.