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

  • 3
    $\begingroup$ $3!=2\cdot3$ ? $\endgroup$ Sep 18, 2010 at 10:39
  • 5
    $\begingroup$ I can add one more $2!=1\cdot 2$ $\endgroup$ Sep 18, 2010 at 10:44
  • 26
    $\begingroup$ 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!}$. $\endgroup$ Sep 18, 2010 at 14:56
  • 5
    $\begingroup$ 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. $\endgroup$
    – user6976
    Sep 18, 2010 at 15:50
  • 7
    $\begingroup$ This is very similar to Brocard's problem, which is unresolved... en.wikipedia.org/wiki/Brocard%27s_problem $\endgroup$
    – user6096
    Sep 18, 2010 at 15:54

3 Answers 3


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.

  • 3
    $\begingroup$ I believe it may be of interest to some to mention that he proof that $n!=P(m)$ has only finitely many solutions when $P$ is irreducible of degree $>2$ is trivial. Indeed, if the equation had infinitely many solution, then for every prime $p$, there would be a solution with $n \geq p$, giving an $m$ which is a root of $P$ modulo $p$. But as is well-known, there is a positive density of primes $p$ such that $P$ has no roots modulo $p$. $\endgroup$
    – Joël
    Aug 16, 2016 at 11:49

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 http://users.jyu.fi/~tamaraja/temp/brogen.c 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 http://users.jyu.fi/~tamaraja/temp/sqrdiv.c

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$.


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$.

  • $\begingroup$ Did you mean $N = [\sqrt{n!}]$ in the first line ? $\endgroup$ Sep 20, 2010 at 11:30
  • $\begingroup$ @Chris. Yes I did. Thanks for the correction. $\endgroup$ Sep 20, 2010 at 12:13
  • 2
    $\begingroup$ The probability that N(N+1) is divisible by 3 is not 1/3, then shouldn't this also be accounted for? $\endgroup$ Sep 20, 2010 at 17:04
  • 1
    $\begingroup$ Probabilistic arguments are clear. They are even more powerful than $abc$-conjecture. $\endgroup$ Sep 21, 2010 at 5:50
  • 2
    $\begingroup$ 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". $\endgroup$ Oct 30, 2010 at 23:45

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.