I have the formula $x! + y! = z!$ and I'm looking for positive integers that make it true. Upon inspection it seems that x = y = 1 and z = 2 is the only solution. The problem is how to show it.

From the definition of the factorial function we know $x! = x(x-1)(x-2)...(2)(1)$

So we can do something like this:

$$ [x(x-1)(x-2)...(2)(1)] + [y(y-1)(y-2)...(2)(1)] = [z(z-1)(z-2)...(2)(1)]$$

we can then factor all of the common terms out on the LHS. $$ [...(2)(1)][x(x-1)(x-2)... + y(y-1)(y-2)...] = [z(z-1)(z-2)...(2)(1)]$$ and divide the common terms out of the right hand side $$[x(x-1)(x-2)...] + [y(y-1)(y-2)...] = [z(z-1)(z-2)...]$$

I'm stuck on how to proceed and how to make a clearer argument that there is only the one solution (if indeed there is only the one solution).

If anybody can provide a hint as to how to proceed I would appreciate it.

  • 8
    $\begingroup$ Suppose without loss of generality that $x \le y$. Then $z!\le 2y!$. $\endgroup$ – Chris Eagle Feb 5 '12 at 0:23
  • $\begingroup$ Does Modular Arithmetic help? $\endgroup$ – user21436 Feb 5 '12 at 0:35
  • $\begingroup$ See also math.stackexchange.com/questions/206679/… $\endgroup$ – Martin Sleziak Aug 14 '14 at 4:29

If $x, y \in \{0,1\}$, then we can always find a solution $z \in \{0, 1, 2\}$. The rest of the post will show that there are no other solutions.

Let us assume $y \geq x \geq 2$ without loss of generality.

Dividing both sides by $x!$ gives $$ 1 + y(y-1)\cdots(x+1) = z(z-1)\cdots(x+1). $$ If $y > x$, we see $x+1$ divides the right-hand side but not the left-hand side ($x+1$ divides one term in the sum but not the other), in which case there are no solutions.

If $y = x$, we may reduce the problem to that of solving $2y! = z!$. Since $y \geq 2$, the left-hand side always has more factors of $2$ than the right-hand side, in which case there are no solutions.


If $x>1$ and $ y \leq x$ then $$x!<x!+y! \leq 2x!<(x+1)!$$ therefore $$x!<z!<(x+1)!$$ so that the only solutions are $(x,y,z)=(0,0,2),(0,1,2),(1,0,2),(1,1,2)$.

  • $\begingroup$ How does the $z!$ come into play in your second equation? $\endgroup$ – Roland Feb 15 '16 at 19:42
  • 1
    $\begingroup$ We already have $z! = x! + y! $ $\endgroup$ – jelec Feb 15 '16 at 19:49

Very shortly, $(x,y,z)=(0,0,2),(0,1,2),(1,0,2),(1,1,2)$ are the only solutions because if WLOG $1<x\le y<z$ then dividing by $y!$ yields $$1+\frac{1}{(x+1)(x+2)\cdots y}=(y+1)(y+2)\cdots z,$$ whose RHS is an integer while its LHS is not.


The problem is how to show it

One way maybe using Stirling's formula that approximates $n!$ as follows:

$n! \approx n \ln (n) - n$

so you could write:

$x \ln(x) - x + y \ln(y) - y \approx z \ln(z) - z$

$z - x - y \approx z \ln(z) - x \ln (x) - y \ln (y)$

one solution to this may be derived by:

$z=z\ln(z)$ and $x=x\ln(x)$ and $y=y\ln(y)$

that is:

$1=\ln(z)$ and $1 = \ln(x)$ and $1 = \ln(y)$

this leads us to the fact that $x, y, z$ are all between $0$ and $e+m$ where $m$ is a small integer greater than or equal to zero. I used the $m$ here since the Sterling formula is not accurate hence the values may not be exact. One could then try manually integers in the range $[0,2+m]$ and construct the different combinations to find at least $1$ solution.

  • $\begingroup$ Unfortunately for the assignment we've been instructed to stay in the integers. So we can't use ln() and such. $\endgroup$ – AvatarOfChronos Feb 5 '12 at 0:56
  • $\begingroup$ A harder problem is x! y! = z!. $\endgroup$ – marty cohen Feb 5 '12 at 3:21
  • $\begingroup$ @Brian M. Scott - Thanks for editing! $\endgroup$ – NoChance Feb 5 '12 at 6:56

If $x!+y!=z!$ in positive integers $x,y,z$, we can assume $x\le y$, and it's clear that $y\le z$. These inequalities imply $x!\mid y!$ and $y!\mid z!$. But

$$y!\mid z!\implies y!\mid(z!-y!)\implies y!\mid x!$$

and this implies $y=x$, so that $z!=2x!$. The only solution to this is $x=1$, $z=2$, so we get $(x,y,z)=(1,1,2)$ as the only solution in positive integers.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.