OFFSET
2,3
COMMENTS
Empirical observation: while generating this sequence, it seems like searching for factors around a window of (n!)^(1/k), where 2 <= k <= n will find likely matches. This is due to the geometric mean of k factors being near (n!)^(1/k). No proof if this heuristic method guarantees finding valid factors, or a numerical lower bound on the window width.
From David A. Corneth, Sep 17 2025: (Start)
When m = 0 is allowed we would have a(n) = 0 for all n and we could define a(1).
As m >= 1, t > 1 and so b_1*b_t <= n! and so b_1 < sqrt(n!) (< as for n >= 2 we have n! is never a square).
More generally b_1 < (n!)^(1/t).
a(n) <= min(A061057(n), n-2) for n>=3 where upper bound n-2 comes from t = n-1, b_1 = 2, b_t = n. (End)
REFERENCES
P. Erdős and R. Graham, Old and new problems and results in combinatorial number theory. Monographies de L'Enseignement Mathématique (1980), p. 76.
LINKS
Thomas Bloom, Problem 393, Erdős Problems.
David A. Corneth, PARI program
David A. Corneth, List of tuples multiplying to n! and giving a(n) for n = 2..79
Charlie Liou, Python program using geometric mean heuristic
Erdős problems database contributors, Issue 92 linking Erdős problems to the OEIS.
EXAMPLE
For n = 3, a(3) = 1 because 3! = 2*3 and 3 - 2 = 1.
For n = 8, a(8) = 4 with two solutions:
8! = 32*35*36, 36-32 = 4
8! = 12*14*15*16, 16-12 = 4.
MATHEMATICA
gens[m_, x_]:=Join[{x}, #, {x+m}]&/@Subsets[x+Range[1, m-1]]
decode[s_, t_]:=If[Length[t]==0, t, s/.t]
process[nf_, s_, x_]:=decode[s, Solve[Times@@s==nf, x, Integers]]
do[n_, m_]:=Flatten[process[n!, #, x]&/@gens[m, x], 1]
do[n_]:=Module[{m, d}, For[m=1, True, m++, d=do[n, m]; If[Length[d]>0, Return[d]]]]
(* From Boris Alexeev (Erdős problems database contributor to Issue 92) who computed a(21)-a(22) *)
PROG
(Python)
from math import prod, factorial
from sympy.ntheory import factorint
from sympy.utilities.iterables import multiset_partitions
def a(n):
prime_factors = [factors for prime in [[i for _ in range(j)] for i, j in factorint(factorial(n)).items()] for factors in prime]
best_m = float('inf')
for partition in multiset_partitions(prime_factors):
factors = sorted([prod(group) for group in partition])
if len(factors) != len(set(factors)): continue
test_m = factors[-1] - factors[0]
if test_m < best_m and len(factors) >= 2: best_m = test_m
return best_m
print([a(n) for n in range(3, 13)])
(PARI) \\ See also David A. Corneth link
R(r, m, u)={my(t=r, e=logint(r, m+1)); if(e>1 && sqrtnint(r, e)<u, fordiv(r, d, my(d2=r/d); if(d>d2 && d2>m && u>d2, t=min(t, self()(d, d2, u))))); t}
a(n)={my(r=n!, t=r-1); fordiv(r, d, my(d2=r/d); if(d>d2, t=min(t, R(d, d2, d2+t)-d2))); t} \\ Andrew Howroyd, Sep 16 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Charlie Liou, Sep 16 2025
EXTENSIONS
a(23)-a(40) from Andrew Howroyd, Sep 16 2025
a(41)-a(79) from David A. Corneth, Sep 19 2025
STATUS
approved
