/- 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. -/ import FormalConjecturesUtil

Erdős Problem 394

References:

    erdosproblems.com/394

    [ErGr80] Erdős, P. and Graham, R., Old and new problems and results in combinatorial number theory. Monographies de L'Enseignement Mathematique (1980).

    [ErHa78] Erdős, P. and Hall, R. R., On some unconventional problems on the divisors of integers. J. Austral. Math. Soc. Ser. A (1978), 479--485.

open Nat Filter Finsetopen scoped Asymptotics Topology Natnamespace Erdos394

Let $t_k(n)$ denote the least $m$ such that $n\mid m(m+1)(m+2)\cdots (m+k-1).$

noncomputable def t (k n : ) : := sInf { m : | 0 < m n i range k, (m + i) }

t k n = v when v works and nothing positive below it does.

@[category API, AMS 11] theorem t_eq_of {n k v : } (hv : 0 < v) (hdvd : n i range k, (v + i)) (hlt : m range v, 0 < m ¬ (n i range k, (m + i))) : t k n = v := n:k:v:hv:0 < vhdvd:n i range k, (v + i)hlt: m range v, 0 < m ¬n i range k, (m + i)t k n = v n:k:v:hv:0 < vhdvd:n i range k, (v + i)hlt: m range v, 0 < m ¬n i range k, (m + i)v t k n n:k:v:hv:0 < vhdvd:n i range k, (v + i)hlt: m range v, 0 < m ¬n i range k, (m + i)hc:t k n < vFalse n:k:v:hv:0 < vhdvd:n i range k, (v + i)hlt: m range v, 0 < m ¬n i range k, (m + i)hc:t k n < vhne:{m | 0 < m n i range k, (m + i)}.NonemptyFalse n:k:v:hv:0 < vhdvd:n i range k, (v + i)hlt: m range v, 0 < m ¬n i range k, (m + i)hc:t k n < vhne:{m | 0 < m n i range k, (m + i)}.Nonemptyhpos:0 < sInf {m | 0 < m n i range k, (m + i)}hd:n i range k, (sInf {m | 0 < m n i range k, (m + i)} + i)False All goals completed! 🐙

The least positive multiple of n is n, so t 1 n = n.

n:hn:0 < nhne:{m | 0 < m n i range 1, (m + i)}.Nonemptyhpos:0 < sInf {m | 0 < m n i range 1, (m + i)}hd:n sInf {m | 0 < m n i range 1, (m + i)}n t 1 n All goals completed! 🐙

Is it true that $\sum_{n\leq x}t_2(n)\ll \frac{x^2}{(\log x)^c}$ for some $c>0$?

@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-394/Research/FirstQuestion.lean"] theorem erdos_394.parts.i : answer(True) c > 0, (fun x n Icc 1 x⌋₊, (t 2 n : )) (fun x x ^ 2 / (Real.log x) ^ c) := True c > 0, (fun x n Icc 1 x⌋₊, (t 2 n)) =O[atTop] fun x x ^ 2 / Real.log x ^ c All goals completed! 🐙

Is it true that, for $k\geq 2$, $\sum_{n\leq x}t_{k+1}(n) =o\left(\sum_{n\leq x}t_k(n)\right)?$

@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-394/Research/DenseHierarchyLittleO.lean"] theorem erdos_394.parts.ii : answer(True) k 2, (fun (x : ) n Icc 1 x⌋₊, (t (k + 1) n : )) =o[atTop] (fun (x : ) n Icc 1 x⌋₊, (t k n : )) := True k 2, (fun x n Icc 1 x⌋₊, (t (k + 1) n)) =o[atTop] fun x n Icc 1 x⌋₊, (t k n) All goals completed! 🐙

In [ErGr80] they mention a conjecture of Erdős that the sum is $o(x^2)$. This was proved by Erdős and Hall [ErHa78], who proved that in fact $\sum_{n\leq x}t_2(n)\ll \frac{\log\log\log x}{\log\log x}x^2.$

@[category research solved, AMS 11] theorem erdos_394.variants.hall_bound : (fun x n Icc 1 x⌋₊, (t 2 n : )) (fun x x ^ 2 * (Real.log (Real.log (Real.log x)) / Real.log (Real.log x))) := (fun x n Icc 1 x⌋₊, (t 2 n)) =O[atTop] fun x x ^ 2 * (Real.log (Real.log (Real.log x)) / Real.log (Real.log x)) All goals completed! 🐙

Erdős and Hall conjecture that the sum is $o(x^2/(\log x)^c)$ for any $c<\log 2$.

@[category research open, AMS 11] theorem erdos_394.variants.hall_conjecture : c < Real.log 2, (fun x n Icc 1 x⌋₊, (t 2 n : )) =o[atTop] (fun x x ^ 2 / (Real.log x) ^ c) := c < Real.log 2, (fun x n Icc 1 x⌋₊, (t 2 n)) =o[atTop] fun x x ^ 2 / Real.log x ^ c All goals completed! 🐙

Since $t_2(p)=p-1$ for prime $p$ it is trivial that $\sum_{n\leq x}t_2(n)\gg \frac{x^2}{\log x}$.

@[category research solved, AMS 11] theorem erdos_394.variants.lower_bound : (fun x x ^ 2 / Real.log x) (fun x n Icc 1 x⌋₊, (t 2 n : )) := (fun x x ^ 2 / Real.log x) =O[atTop] fun x n Icc 1 x⌋₊, (t 2 n) All goals completed! 🐙

They ask about the behaviour of $t_{n-3}(n!)$ and also ask whether, for infinitely many $n$, $t_k(n!)< t_{k-1}(n!)-1$ for all $1\leq k < n$.

@[category research open, AMS 11] theorem erdos_394.variants.factorial_gap_conjecture : answer(sorry) Set.Infinite { n : | k, 2 k k < n t k (n !) < t (k - 1) (n !) - 1 } := True {n | (k : ), 2 k k < n t k n ! < t (k - 1) n ! - 1}.Infinite All goals completed! 🐙set_option maxRecDepth 20000 in

They proved (with Selfridge) that this holds for $n=10$.

h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2 (k : ), 2 k k < 10 t k 10! < t (k - 1) 10! - 1 h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 khk10:k < 10t k 10! < t (k - 1) 10! - 1 h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 2hk10:2 < 10t 2 10! < t (2 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 3hk10:3 < 10t 3 10! < t (3 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 4hk10:4 < 10t 4 10! < t (4 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 5hk10:5 < 10t 5 10! < t (5 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 6hk10:6 < 10t 6 10! < t (6 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 7hk10:7 < 10t 7 10! < t (7 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 8hk10:8 < 10t 8 10! < t (8 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 9hk10:9 < 10t 9 10! < t (9 - 1) 10! - 1 h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 2hk10:2 < 10t 2 10! < t (2 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 3hk10:3 < 10t 3 10! < t (3 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 4hk10:4 < 10t 4 10! < t (4 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 5hk10:5 < 10t 5 10! < t (5 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 6hk10:6 < 10t 6 10! < t (6 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 7hk10:7 < 10t 7 10! < t (7 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 8hk10:8 < 10t 8 10! < t (8 - 1) 10! - 1h1:t 1 10! = 3628800h2:t 2 10! = 512000h3:t 3 10! = 6398h4:t 4 10! = 5373h5:t 5 10! = 348h6:t 6 10! = 160h7:t 7 10! = 30h8:t 8 10! = 9h9:t 9 10! = 2k:hk2:2 9hk10:9 < 10t 9 10! < t (9 - 1) 10! - 1 All goals completed! 🐙end Erdos394