/-
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.
-/
module
public import FormalConjecturesUtilLeast $m > 0$ such that ${2^k - k : k = 1, \dots, m}$ covers all residues modulo $n$
For $n \ge 1$, $a(n)$ is the least positive integer $m$ such that ${2^k - k : k = 1, \dots, m}$ contains a complete system of residues modulo $n$.
References:
T. Adamczewski, "OEIS Open: How many conjectures can language models turn into theorems?", arXiv:2608.11941 [cs.AI], 2026.
@[expose] public sectionnamespace OeisA232616The predicate that ${2^k - k : k = 1, \dots, m}$ contains a complete system of residues modulo $n$.
def HasCompleteResidueSystem (n m : ℕ) [NeZero n] : Prop :=
(Finset.univ : Finset (ZMod n)) =
(Finset.Icc 1 m).image fun k ↦ (Nat.cast (2 ^ k - k) : ZMod n)instance (n m : ℕ) [NeZero n] : Decidable (HasCompleteResidueSystem n m) :=
decEq _ _Least positive integer $m$ such that ${2^k - k : k = 1, \dots, m}$ contains a complete system of residues modulo $n$.
noncomputable def a (n : ℕ) : ℕ :=
if h : n = 0 then 0
else
have : NeZero n := NeZero.mk h
sInf { m : ℕ | HasCompleteResidueSystem n m }⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 1 m}) =
1
exact IsLeast.csInf_eq (by ⊢ IsLeast {m | HasCompleteResidueSystem 1 m} 1 decide All goals completed! 🐙)
@[category test, AMS 11]
theorem a_2 : a 2 = 2 := by ⊢ a 2 = 2
rw [a, ⊢ (if h : 2 = 0 then 0
else
have this := ⋯;
sInf {m | HasCompleteResidueSystem 2 m}) =
2 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 2 m}) =
2 dif_neg (by ⊢ ¬2 = 0 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 2 m}) =
2 decide All goals completed! 🐙 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 2 m}) =
2)] ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 2 m}) =
2
exact IsLeast.csInf_eq (by ⊢ IsLeast {m | HasCompleteResidueSystem 2 m} 2 decide All goals completed! 🐙)
@[category test, AMS 11]
theorem a_3 : a 3 = 4 := by ⊢ a 3 = 4
rw [a, ⊢ (if h : 3 = 0 then 0
else
have this := ⋯;
sInf {m | HasCompleteResidueSystem 3 m}) =
4 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 3 m}) =
4 dif_neg (by ⊢ ¬3 = 0 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 3 m}) =
4 decide All goals completed! 🐙 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 3 m}) =
4)] ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 3 m}) =
4
exact IsLeast.csInf_eq (by ⊢ IsLeast {m | HasCompleteResidueSystem 3 m} 4 decide All goals completed! 🐙)
@[category test, AMS 11]
theorem a_4 : a 4 = 5 := by ⊢ a 4 = 5
rw [a, ⊢ (if h : 4 = 0 then 0
else
have this := ⋯;
sInf {m | HasCompleteResidueSystem 4 m}) =
5 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 4 m}) =
5 dif_neg (by ⊢ ¬4 = 0 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 4 m}) =
5 decide All goals completed! 🐙 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 4 m}) =
5)] ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 4 m}) =
5
exact IsLeast.csInf_eq (by ⊢ IsLeast {m | HasCompleteResidueSystem 4 m} 5 decide All goals completed! 🐙)
@[category test, AMS 11]
theorem a_5 : a 5 = 10 := by ⊢ a 5 = 10
rw [a, ⊢ (if h : 5 = 0 then 0
else
have this := ⋯;
sInf {m | HasCompleteResidueSystem 5 m}) =
10 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 5 m}) =
10 dif_neg (by ⊢ ¬5 = 0 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 5 m}) =
10 decide All goals completed! 🐙 ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 5 m}) =
10)] ⊢ (have this := ⋯;
sInf {m | HasCompleteResidueSystem 5 m}) =
10
exact IsLeast.csInf_eq (by ⊢ IsLeast {m | HasCompleteResidueSystem 5 m} 10 decide All goals completed! 🐙)Conjecture (i): $a(n) < 2 \cdot (\text{prime}(n) - 1)$ for all $n > 0$, where $\text{prime}(n)$ is the $n$-th prime number (1-indexed).
Disproved for $n = 550172$ in the OEIS Open project, see T. Adamczewski, OEIS Open: How many conjectures can language models turn into theorems?, arXiv:2608.11941.
@[category research solved, AMS 11]
theorem conjecture_1 : ¬ ∀ n > 0, a n < 2 * (Nat.nth Nat.Prime (n - 1) - 1) := by ⊢ ¬∀ n > 0, OeisA232616.a n < 2 * (Nat.nth Nat.Prime (n - 1) - 1)
sorry All goals completed! 🐙Conjecture (ii), first equation: The Diophantine equation $x^n - n = y^m$ with $m, n, x, y > 1$ only has two integral solutions: $2^5 - 5 = 3^3$ and $2^7 - 7 = 11^2$.
@[category research open, AMS 11]
theorem conjecture_2 (x y n m : ℕ) (hx : 1 < x) (hy : 1 < y) (hn : 1 < n) (hm : 1 < m) :
x ^ n - n = y ^ m ↔ (x = 2 ∧ n = 5 ∧ y = 3 ∧ m = 3) ∨ (x = 2 ∧ n = 7 ∧ y = 11 ∧ m = 2) := by x:ℕy:ℕn:ℕm:ℕhx:1 < xhy:1 < yhn:1 < nhm:1 < m⊢ x ^ n - n = y ^ m ↔ x = 2 ∧ n = 5 ∧ y = 3 ∧ m = 3 ∨ x = 2 ∧ n = 7 ∧ y = 11 ∧ m = 2
sorry All goals completed! 🐙Conjecture (ii), second equation: The Diophantine equation $x^n + n = y^m$ with $m, n, x, y > 1$ only has two integral solutions: $5^2 + 2 = 3^3$ and $5^3 + 3 = 2^7$.
@[category research open, AMS 11]
theorem conjecture_3 (x y n m : ℕ) (hx : 1 < x) (hy : 1 < y) (hn : 1 < n) (hm : 1 < m) :
x ^ n + n = y ^ m ↔ (x = 5 ∧ n = 2 ∧ y = 3 ∧ m = 3) ∨ (x = 5 ∧ n = 3 ∧ y = 2 ∧ m = 7) := by x:ℕy:ℕn:ℕm:ℕhx:1 < xhy:1 < yhn:1 < nhm:1 < m⊢ x ^ n + n = y ^ m ↔ x = 5 ∧ n = 2 ∧ y = 3 ∧ m = 3 ∨ x = 5 ∧ n = 3 ∧ y = 2 ∧ m = 7
sorry All goals completed! 🐙end OeisA232616