/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/modulepublicimportFormalConjecturesUtilpublicimportFormalConjectures.Wikipedia.ABC
[ErGr80] Erdős, P. and Graham, R., Old and new problems and results in combinatorial number
theory. Monographies de L'Enseignement Mathematique (1980).
[BeOs92] Berend, Daniel and Osgood, Charles F., On the equation $P(x)=n!$ and a question of
Erdős. J. Number Theory 42 (1992), 189-193.
[BPZ23] Bui, Hung M. and Pratt, Kyle and Zaharescu, Alexandru, Power savings for counting
solutions to polynomial-factorial equations. Adv. Math. 422 (2023), Paper No. 109021, 32 pp.
arXiv:2204.08423
[Lu02] Luca, Florian, The Diophantine equation $P(x)=n!$ and a result of M. Overholt.
Glas. Mat. Ser. III 37 (2002), 269-273.
f n is $f(n)$, the minimal $m \geq 1$ such that $n! = a_1 \cdots a_t$ with
$a_1 < \cdots < a_t = a_1 + m$. The factors are recorded as a finite set
$s \subseteq [a, a + m]$ of natural numbers that contains $a = a_1$ and $a + m = a_t$. Since
$m \geq 1$ there are at least two factors, and they are positive because $n! \neq 0$.
Such a factorisation exists for $n \geq 2$. For $n \leq 1$ there is none, since $n! = 1$, and
f n is the junk value 0.
Let $f(n)$ denote the minimal $m\geq 1$ such that
$$n! = a_1\cdots a_t$$
with $a_1<\cdots <a_t=a_1+m$. What is the behaviour of $f(n)$?
We formalise the question as: does $f(n) \to \infty$? A result of Luca [Lu02] implies a positive
answer, conditional on the $abc$ conjecture (see Erdos393.erdos_393.variants.luca).
Erdős and Graham [ErGr80, p. 76] write that they do not even know whether $f(n) = 1$ for infinitely
many $n$, that is, whether a factorial is the product of two consecutive integers infinitely
often.
Let $F_m(N)$ count the number of $n \leq N$ such that $f(n) = m$. A theorem of Berend and
Osgood [BeOs92] implies that, for each fixed $m$, $F_m(N) = o(N)$, that is,
${n : f(n) = m}$ has natural density $0$.
They proved that, for every $P \in \mathbb{Z}[x]$ of degree at least $2$, the set of $n$ such
that $P(x) = n!$ has an integer solution has density $0$. For $m \geq 1$ this applies because
$f(n) = m$ gives $n! = P(a_1)$ for one of the finitely many polynomials
$P(x) = \prod_{j \in S} (x + j)$ with ${0, m} \subseteq S \subseteq {0, \ldots, m}$. For
$m = 0$ the set is ${0, 1}$ (the junk values), so the statement is trivial.
A theorem of Bui, Pratt, and Zaharescu [BPZ23] implies that, for each fixed $m$,
$$F_m(N) \ll_m N^{33/34},$$
where $F_m(N)$ is the number of $n \leq N$ such that $f(n) = m$.
They proved that, for every $P \in \mathbb{Z}[x]$ of degree at least $2$, the number of
$N \leq n < 2N$ such that $P(x) = n!$ has an integer solution is $\ll_P N^{33/34}$. Summing over
the finitely many polynomials in Erdos393.erdos_393.variants.berend_osgood and over the dyadic
ranges $[2^i, 2^{i+1})$ gives the bound for $n \leq N$.
Luca [Lu02] proved that the $abc$ conjecture implies that, for every $P \in \mathbb{Z}[x]$ of
degree at least $2$, the equation $P(x) = n!$ has only finitely many solutions. As remarked on
erdosproblems.com, this implies that $f(n) \to \infty$, conditional on the $abc$ conjecture
(ABC.abc).