# Solutions for x!/y!=(y+1)!

I was watching a video recently, and I saw how 10*9*8*7 was equal to 7*6*5*4*3*2*1, or to make it clearer, 10!/6!=7!. I was wondering if there were any other solutions, so I checked the web, to find nothing. I also checked Wolfram alpha, but it gave me just two extra solutions for x=10 and point.

So, what kind of solutions are there? Are there infinite solutions for any arbitrary x? Are there infinite integer solutions for x and y?

Anything would help, I have no idea of how to find these kinds of solutions...

EDIT: Thomas Andrews told me that when talking about negative integers I should use the Gamma function. But to make it simple, can you simply extend the question to negative or complex numbers? Thanks.

• just saying.. the graph is epic... wolframalpha.com/input/?i=x%21%3D%28y%2B1%29%28y%21%29%5E2 – kaine Aug 30 '13 at 15:07
• If you are talking about factorials, you are always talking about non-negative integers. If you want to talk about the gamma function, then don't use the word factorial, nor write $x!$ if $x$ is not a non-negative integer. – Thomas Andrews Aug 30 '13 at 15:39
• Unbelievable graph indeed!!! +1 – Parth Thakkar Aug 30 '13 at 15:39
• @ThomasAndrews Edited comment to your opinion. – Anonymous Pi Aug 30 '13 at 16:03
• You'll find a couple of relevant citations in the answers to this question. – Rick Decker Aug 30 '13 at 18:02

Consider the primes that occur in the range $\frac{x}{2} < p_i < x$.

If $x! = (y!)^2 (y+1)$, then each prime $p_i$ must occur exactly once, which means that $y < p_i$, and thus $y=p_i + 1$. Hence, if we have 2 primes in the range, then there is no possible value of $y$ that satisfies the equation.

We use a stronger form of Bertrand's Postulate, which state that if $n \geq 12$, then there is a prime between $n$ and $\frac{4}{3}n$. In particular, this gives us 2 primes between $n$ and $\left(\frac{4}{3} \right)^2n < 2n$.

Hence, we need only check for solutions up to $x= 25$. I leave you to check that the only solutions are $(x,y) = (10,6), (2,1), (1,0)$

Note, the generalized version of Bertrand's postulate states that, for any constant $k>1$, there exists an integer $N$ such that for all $n>N$, there is a prime between $n$ and $kn$.

I just happen to know that for $k= \frac{4}{3}$, $N=12$. This gives 2 primes between $n$ and $2n$, which is often useful (like in this case).

• Wonderful! You should fill in the (small) details so that most people can breeze through reading it. – abnry Aug 30 '13 at 15:52

We are solving $x! = y! (y+1)! = (y+1)(y!)^2$ over the positive integers.

We can prove the following. Given $x$, and $p$ the largest prime less than or equal to $x$, then $y=p-1$. In fact, if $y\geq p$, then $p^2 | y!(y+1)!$, but $p^2$ does not divide $x!$. If $y < p-1$, then $p$ does not divide $y! (y+1)!$, but $p | x!$.

Note the above is the case with $x=10$ and $y=6$.

My hope is that using some fact about prime numbers, such as the prime density theorem, we can prove that for $x \geq M$ for some $M$, there are no solutions. That is, there are a finite number of solutions.

EDIT: Using the generalized Bertrand's postulate, for large enough numbers, there is a prime $p$ with $x \geq p\geq 3/4 x$. Then if a solution exists, $$x! = \Gamma(x+1) = \Gamma(p+1)\Gamma(p+2) \geq \Gamma(p+1)^2 \geq \Gamma(3x/4+1)^2.$$ Substituting Stirling's formula gives $$(x/e)^x \sqrt{2 \pi x} \geq [(3x/4e)^{3x/4} \sqrt{2 \pi (3x/4)}]^2$$ which simplifies to $$\sqrt{2 \pi x} \geq \frac{3 \pi}{2} x \left(\left(3/4e\right)^3 x \right)^{x/2}.$$

However, as $x \to \infty$, the RHS goes to infinity faster than the LHS. Hence, the inequality is violated and we conclude that there are a finite number of solutions. (All of the above can be made rigorous, knowing that Stirling's formula is an asymptotic result, and dealing with limits.)

• In concluding $p^2$ does not divide $x!$ for largest prime $p \le x$ you might want to mention Bertrand's postulate which gives that for sufficiently large $x$, $p > x/2$. – hardmath Aug 30 '13 at 15:29
• Yes, I'm thinking about that now. I think then using Stirling's formula we can get our upper bound. – abnry Aug 30 '13 at 15:30
• Small mistake: it should be $y = 6 = 7 - 1$ not $y = 7$. – Pratyush Sarkar Aug 30 '13 at 15:31
• If $y+1=p$ then that would mean that $x!=p(y!)^2$, which would mean that no prime other than $p$ goes into $x!$ an odd number of times. – Thomas Andrews Aug 30 '13 at 15:34
• @ThomasAndrews Indeed. The generalized version of Bertrand's postulate works for that. We can show that there are 2 primes between $n$ and $2n$, for large enough $n$. – Calvin Lin Aug 30 '13 at 15:43

I do not know what Wolfram alpha does, but

$$x=2,$$ $$y=1,$$

satisfies $\frac{x!}{y!}=(y+1)!$.

• Since conventionally $0! = 1$ we can also claim $x=1$ as a solution. – hardmath Aug 30 '13 at 15:06
• @hardmath -absolutely correct. – Avitus Aug 30 '13 at 15:07
• @hardmath Presumably, you mean $x=1,y=0$ is a soluion? – Thomas Andrews Aug 30 '13 at 15:13
• @ThomasAndrews: Yes. – hardmath Aug 30 '13 at 15:14

There's no mathematical approach to find the sequence of all such terms.

ie, you cant find the next possible solution based on the current solution, & thereby,cannot derive a general equation for finding such solutions.

However, you can simply try different combinations to see if any of them satisfy the solution of the problem. Following code checks if such solution exists upto 100!

for i=1 to 100
for j=0 to i
{
if(i!/j!==(j+1)!)      // you'll have to do a function to find factorial too
//print i,j
}


A similar problem like yours is, 1^3 + 5^3 + 3^3 = 153 . same for 370 & 371....

so there's no formula to find first term 153, or the next terms 370 & 371. You just have to check if the different combinations of numbers satisfy the solution or not.

• In what is the code programmed? I know C++... – Anonymous Pi Aug 30 '13 at 15:32
• Its a pseudocode. ie you can add proper syntax & run into a language of your choice. You can convert it into c++ by adding required syntax. However, when you try first time, I suggest you try for a value considerably lesser than 100, because it'll take too much time to run the for loops for 100. – Sumedh Aug 30 '13 at 15:51
• Thanks! I think however, that factorials in C++ (the language I use) won't be able to take even numbers like 20!. But I'll try to implement something like that in Mathematica. Thanks again! – Anonymous Pi Aug 30 '13 at 16:01
• Over forty years ago, I proved that, for any base and exponent, there are only a finite number of integers that have the sum of their digits digits raised to the exponent power ($\sum d_i^k$) equal to the integer. – marty cohen Oct 10 '13 at 20:32