MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is anybody know a solution of this problem? (Sorry, I've missed one summand in the previous post.)

share|cite|improve this question
$3!=2\cdot3$ ? – Joel David Hamkins Sep 18 '10 at 10:39
I can add one more $2!=1\cdot 2$ – Alexey Ustinov Sep 18 '10 at 10:44
Before someone posts an elementary solution, note that abc conjecture implies finitely many solutions since $rad(n!) = \prod_{p<n} p \sim e^n$ and $(e^n)^{1+\epsilon} < \sqrt{n!}$. – Dror Speiser Sep 18 '10 at 14:56
If $n$ is a solution then $4n!+1$ is a square, but it looks like if $n\ne 2,3$, $4n!+1$ is not divisible by a square of a prime. – Mark Sapir Sep 18 '10 at 15:50
This is very similar to Brocard's problem, which is unresolved... – Byron Schmuland Sep 18 '10 at 15:54
up vote 26 down vote accepted

I'm pretty sure this is open. As suggested from Brocard's problem, it is interesting to investigate the Diophantine equations $$n!=P(m)$$ for polynomials $P$. You can see the paper "On polynomial-factorial diophantine equations", by D. Berend, J.E. Harmse where they make some advances on the problem and prove that this equation has finitely many solutions for many classes of polynomials (irreducible, with an irreducible factor of large degree or with an irreducible factor to a large power).

So by their results it is known that the equation $n!=m^r(m+1)$ has finitely many solutions if $r\geq 4$. But for $r\in \{1,2,3\}$ the problem is open.

share|cite|improve this answer

I thought I should share with you the results from my computations from the past two days. All these computations could be carried out to significantly higher limits with better code and a bit more time. However, my motivation was just to play with them.

Please check the code before taking these computations as facts! I did not check the code too carefully.

Computation 1

The equation $$n! = m(m+1)$$ does not have integer solutions for $3 < n < 10^9$.

I used Mark Sapir's observation that if $n$ is a solution then $4n!+1$ is a square. I wrote a small program which calculates Legendre symbols $$\left(\frac{4n!+1}{p}\right),$$ with a set of primes $p>n$, to check if there might be a solution for $n$. Confirming that for $3 < n < 10^9$ there are no solutions took about one hour on my laptop using 40 primes. The code is available at for anyone interested to see it.

Computation 2

I wanted to test the slightly stronger guess in Mark Sapir's post that for $p>5$, $p^2$ does not divide any integer of the form $4n!+1$. This turned out not to be true. I checked that for $5 < p <10^6$ there is one exception, namely $$761671^2 ~|~ 4\cdot446142!+1.$$ Here I used only brute force and the trivial observation that $$p ~|~ 4n!+1 \Rightarrow n < p.$$ Testing this range for $p$ took a couple of hours. The code is available at

Computation 3

Byron Schmuland pointed out the similarity to Brocard's problem in his comment. Because the previous computations I found for the equation $$n! + 1 = m^2$$ were carried out over a decade ago, I decided to extend them a bit.

With the same approach which was used by Berndt and Galway in 2000 (and in Computation 1 above) I confirmed that the equation has no solutions for $7 < n < 10^{10}$. This took about one day. The code was the same as in Computation 1.

Computation 4

After the previous 3 computations I did a little bit of the "missing" fourth. The equation $$n!+1 \equiv 0 \pmod{p^2}$$ has no solutions $(p,n)$ with $p$ prime and $613 < p < 10^6$.

share|cite|improve this answer

Let us look for a probabilistic hint. Given $n\ge3$, define $N:=[\sqrt{n!}]$, the integer part of the square root $n!$ . Then $n!\in[N^2+1,\ldots,N^2+2N]$. The answer to the question is positive if and only if $n!=N^2+N$, because $m$ has to be $N$. At first glance, the probability of this event is $1/2N$. However, we know a priori that both $n!$ and $N(N+1)$ are even. Therefore this probability is $1/N\sim(n!)^{-1/2}$.

Since the series $$\sum_{n=2}^{\infty}\frac{1}{\sqrt{n!}}$$ converges, I expect that the number of solutions to this problem be finite. Actually, I checked that the answer is No for $4\le n\le 10$. Then the number of solutions with $n\ge4$ can be estimated by the series $$\sum_{n=11}^{\infty}\frac{1}{\sqrt{n!}}$$ Because this number is very small (not greater than $10^{-3}$), I bet that there does not exist a solution $n\ge4$.

This is the same kind of reasoning that is used to guess that there does not exist a prime number among Fermat numbers $F_m$ with $m\ge5$.

share|cite|improve this answer
Did you mean $N = [\sqrt{n!}]$ in the first line ? – Chris Wuthrich Sep 20 '10 at 11:30
@Chris. Yes I did. Thanks for the correction. – Denis Serre Sep 20 '10 at 12:13
The probability that N(N+1) is divisible by 3 is not 1/3, then shouldn't this also be accounted for? – Dror Speiser Sep 20 '10 at 17:04
Probabilistic arguments are clear. They are even more powerful than $abc$-conjecture. – Alexey Ustinov Sep 21 '10 at 5:50
Assuming this is an heuristic argument, I still have a problem with this when using a serie: I feel you are making some regularity assumption that you do not specify. In fact there could be very very few $n$ - yet an infinite number- ( like one every triple exponential) that will not change the serie convergence and not by much. Could you specify that "regularity" or "independence". – Jérôme JEAN-CHARLES Oct 30 '10 at 23:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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