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

Least integer $m > 1$ dividing no sum of two distinct primorials up to $P_n$

For $n \ge 1$, $a(n)$ is the least integer $m > 1$ such that $m$ divides none of $P_i + P_j$ with $0 < i < j \le n$, where $P_k$ is the product of the first $k$ primes.

References:

@[expose] public sectionnamespace OeisA210186

Least integer $m > 1$ such that $m$ divides none of $P_i + P_j$ with $0 < i < j \le n$, where $P_k$ is the $k$-th primorial Nat.kthPrimorial k.

noncomputable def a (n : ℕ) : ℕ := sInf { m : ℕ | 1 < m ∧ ∀ i j : ℕ, 1 ≤ i → i < j → j ≤ n → ¬ (m ∣ (Nat.kthPrimorial i + Nat.kthPrimorial j)) }@[category test, AMS 11] theorem a_1 : a 1 = 2 := ⊢ a 1 = 2 ⊢ IsLeast {m | 1 < m ∧ ∀ (i j : ℕ), 1 ≤ i → i < j → j ≤ 1 → ¬m ∣ i.kthPrimorial + j.kthPrimorial} 2 refine ⟨⟨⊢ 1 < 2 All goals completed! 🐙, fun i j hi hij hj => i:ℕj:ℕhi:1 ≤ ihij:i < jhj:j ≤ 1⊢ ¬2 ∣ i.kthPrimorial + j.kthPrimorial All goals completed! 🐙⟩, fun m hm => hm.1⟩hm:2 ∈ {m | 1 < m ∧ ∀ (i j : ℕ), 1 ≤ i → i < j → j ≤ 2 → ¬m ∣ i.kthPrimorial + j.kthPrimorial}hlt:2 < 3this:¬2 ∣ Nat.kthPrimorial 1 + Nat.kthPrimorial 2⊢ False All goals completed! 🐙m:ℕhm:4 ∈ {m | 1 < m ∧ ∀ (i j : ℕ), 1 ≤ i → i < j → j ≤ 3 → ¬m ∣ i.kthPrimorial + j.kthPrimorial}hlt:4 < 5hm_gt:1 < 4this:¬4 ∣ Nat.kthPrimorial 1 + Nat.kthPrimorial 2⊢ False; All goals completed! 🐙m:ℕhm:6 ∈ {m | 1 < m ∧ ∀ (i j : ℕ), 1 ≤ i → i < j → j ≤ 4 → ¬m ∣ i.kthPrimorial + j.kthPrimorial}hlt:6 < 7hm_gt:1 < 6this:¬6 ∣ Nat.kthPrimorial 2 + Nat.kthPrimorial 3⊢ False; All goals completed! 🐙m:ℕhm:10 ∈ {m | 1 < m ∧ ∀ (i j : ℕ), 1 ≤ i → i < j → j ≤ 5 → ¬m ∣ i.kthPrimorial + j.kthPrimorial}hlt:10 < 11hm_gt:1 < 10this:¬10 ∣ Nat.kthPrimorial 3 + Nat.kthPrimorial 4⊢ False; All goals completed! 🐙

"Conjecture: all the terms are primes."

    Zhi-Wei Sun, Mar 18 2012

@[category research open, AMS 11] theorem conjecture_1 (n : ℕ) (hn : 1 ≤ n) : (a n).Prime := n:ℕhn:1 ≤ n⊢ Nat.Prime (a n) All goals completed! 🐙

"Conjecture: $a(n) < n^2$ for all $n > 1$."

    Zhi-Wei Sun, Mar 18 2012

@[category research open, AMS 11] theorem conjecture_2 (n : ℕ) (hn : 1 < n) : a n < n ^ 2 := n:ℕhn:1 < n⊢ a n < n ^ 2 All goals completed! 🐙end OeisA210186