/- Copyright 2025 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. -/ module public import FormalConjecturesUtil /-! # Erdős Problem 889 *Reference:* [erdosproblems.com/889](https://www.erdosproblems.com/889) -/ @[expose] public section open Finset Nat Filter Topology namespace Erdos889 /-- $v(n,k)$ counts the prime factors of $n+k$ which do not divide $n+i$ for all $0 \le i < k$. -/ def v (n k : ℕ) : ℕ := ((n + k).primeFactors.filter (fun p => ∀ i ∈ range k, ¬ p ∣ n + i)).card /-- $v_0(n)$ is the supremum of $v(n,k)$ for all $k \ge 0$. -/ noncomputable def v₀ (n : ℕ) : ℕ∞ := ⨆ k, (v n k : ℕ∞) /-- Let $v(n,k)$ count the prime factors of $n+k$ which do not divide $n+i$ for $0\leq i < k$. Is it true that $v_0(n)=\max_{k\geq 0}v(n,k)\to \infty$ as $n\to \infty$? -/ @[category research open, AMS 11] theorem erdos_889 : Tendsto v₀ atTop (𝓝 ⊤) := by sorry /-- $v_0(n) > 1$ for all $n$ except $n$ = 0, 1, 2, 3, 4, 7, 8, 16 [ErSe67] Erdős, P. and Selfridge, J. L., Some problems on the prime factors of consecutive integers. Illinois J. Math. (1967), 428--430. -/ @[category research solved, AMS 11] theorem erdos_889.variants.v0_gt_1 : ∀ n : ℕ, n ∉ ({0, 1, 2, 3, 4, 7, 8, 16} : Finset ℕ) → 1 < v₀ n := by sorry /-- $v_l(n)$ is the supremum of $v(n,k)$ for all $k \ge l$ -/ noncomputable def v_l (l n : ℕ) : ℕ∞ := ⨆ k ≥ l, (v n k : ℕ∞) /-- Let $v_l(n) = \max_{k\geq l} v(n,k)$. For every fixed $l$, $v_l(n) \to \infty$ as $n \to \infty$ [ErSe67] Erdős, P. and Selfridge, J. L., Some problems on the prime factors of consecutive integers. Illinois J. Math. (1967), 428--430. -/ @[category research open, AMS 11] theorem erdos_889.variants.general : ∀ l, Tendsto (v_l l) atTop (𝓝 ⊤) := by sorry /-- Does $v_1(n) = 1$ have finite solutions? [ErSe67] Erdős, P. and Selfridge, J. L., Some problems on the prime factors of consecutive integers. Illinois J. Math. (1967), 428--430. -/ @[category research open, question, AMS 11] theorem erdos_889.variants.v1_eq_1_finite : {n | v_l 1 n = 1}.Finite := by sorry /-- $V(n,k)$ is the number of primes $p$ such that $p^\alpha$ exactly divides $n+k$ and for all $0 \le i < k$, $p^\alpha$ does not divide $n+i$, where $\alpha$ is the multiplicity of $p$ in the factorization of $n+k$. -/ def V (n k : ℕ) : ℕ := ((n + k).primeFactors.filter (fun p => ∀ i ∈ range k, ¬ p ^ ((n + k).factorization p) ∣ n + i)).card /-- $V_l(n)$ is the supremum of $V(n,k)$ for all $k \ge l$ -/ noncomputable def V_l (l n : ℕ) : ℕ∞ := ⨆ k ≥ l, (V n k : ℕ∞) set_option linter.style.formal_proof_palomar false in /-- Does $V_1(n) = 1$ have finite solutions? This is a modification of `erdos_889.variants.v1_eq_1_finite`, which might make it more amenable to attack according to [ErSe67]. Kenta Kitamura (KitaKen1 on GitHub) has given a Lean proof ([erdos-889-capital-v1-finite](https://github.com/KitaKen1/erdos-889-capital-v1-finite)) that there are only finitely many $n$ with $V_1(n) = 1$. [ErSe67] Erdős, P. and Selfridge, J. L., Some problems on the prime factors of consecutive integers. Illinois J. Math. (1967), 428--430. -/ @[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/KitaKen1/erdos-889-capital-v1-finite/blob/44d38dd7f618dbaa0b08fb976c0378b4897021cd/lean/Erdos889V1FiniteFC.lean#L999-L1004"] theorem erdos_889.variants.V1_eq_1_finite : {n | V_l 1 n = 1}.Finite := by sorry end Erdos889