22. Let $x>1, y>1$ and $z>1$ be positive integers for which the following equation
$$
1!+2!+3!+\ldots+x!=y^{2}
$$
is satisfied. Find the largest possible value of $x+y+z$.
22. Answer. 8
Solution. We first prove that if $x \geq 8$, then $z=2$. To this end, we observe that the left hand side of the equation $1!+2!+3!+\ldots+x!$ is divisible by 3 , and hence $3 \mid y^{2}$. Since 3 is a prime, $3 \mid y$. So, $3^{z} \mid y^{z}$ by elementary properties of divisibility.
On the other hand, when $x=8$,
$$
1!+2!+\ldots+8!=46233
$$
is divisible by $3^{2}$ but not by $3^{3}$. Now, note that if $n \geq 9$, then we have $3^{3} \mid n!$. So, when $x \geq 8$, the left hand side is divisible by $3^{2}$ but not by $3^{3}$. This means that $z=2$.
We now prove further that when $x \geq 8$, then the given equation has no solutions. To prove this, we observe that $x \geq 8$ implies that
$$
1!+2!+3!+4!+\underbrace{5!+\ldots x!}_{\text {divisisble by } 5} \equiv 3(\bmod 5) .
$$

Since we have deduced that $z=2$, we only have $y^{2} \equiv 0,1,-1 \quad(\bmod 5)$. This mismatch now completes the argument that there are no solutions to the equation when $x \geq 8$.
So the search narrows down to $x<8$. By exhaustion, it is easy to find that there is only one solution:
$$
x=y=3, z=2 .
$$

Thus, the sum of this only combination must be the largest and is equal to $3+3+2=8$.