/-
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
namespace OeisA114137open Nat
The primary defining sequence a.
$a(n)$ is the difference between first odd semiprime > $2^n$ and $2^n$.
$$a(n) = \min {s \mid s > 2^n \text{ and } s \text{ is an odd semiprime}} - 2^n$$
noncomputable def a (n : ℕ) : ℕ :=
let m := 2^n
let s : Set ℕ := { s | s > m ∧ s.IsSemiprime ∧ Odd s }
sInf s - mAll goals completed! 🐙@[category test, AMS 11]
theorem a_1 : a 1 = 7 := by ⊢ a 1 = 7
apply a_eq_of 1 9 (by ⊢ IsSemiprime 9 ∧ Odd 9 native_decide All goals completed! 🐙) (by ⊢ 2 ^ 1 < 9 norm_num All goals completed! 🐙)
intro x h1 h2 x:ℕh1:2 ^ 1 < xh2:x < 9⊢ ¬(x.IsSemiprime ∧ Odd x)
interval_cases x «3» x:ℕh1:2 ^ 1 < 3h2:3 < 9⊢ ¬(IsSemiprime 3 ∧ Odd 3)«4» x:ℕh1:2 ^ 1 < 4h2:4 < 9⊢ ¬(IsSemiprime 4 ∧ Odd 4)«5» x:ℕh1:2 ^ 1 < 5h2:5 < 9⊢ ¬(IsSemiprime 5 ∧ Odd 5)«6» x:ℕh1:2 ^ 1 < 6h2:6 < 9⊢ ¬(IsSemiprime 6 ∧ Odd 6)«7» x:ℕh1:2 ^ 1 < 7h2:7 < 9⊢ ¬(IsSemiprime 7 ∧ Odd 7)«8» x:ℕh1:2 ^ 1 < 8h2:8 < 9⊢ ¬(IsSemiprime 8 ∧ Odd 8) <;> «3» x:ℕh1:2 ^ 1 < 3h2:3 < 9⊢ ¬(IsSemiprime 3 ∧ Odd 3)«4» x:ℕh1:2 ^ 1 < 4h2:4 < 9⊢ ¬(IsSemiprime 4 ∧ Odd 4)«5» x:ℕh1:2 ^ 1 < 5h2:5 < 9⊢ ¬(IsSemiprime 5 ∧ Odd 5)«6» x:ℕh1:2 ^ 1 < 6h2:6 < 9⊢ ¬(IsSemiprime 6 ∧ Odd 6)«7» x:ℕh1:2 ^ 1 < 7h2:7 < 9⊢ ¬(IsSemiprime 7 ∧ Odd 7)«8» x:ℕh1:2 ^ 1 < 8h2:8 < 9⊢ ¬(IsSemiprime 8 ∧ Odd 8) native_decide All goals completed! 🐙@[category test, AMS 11]
theorem a_2 : a 2 = 5 := by ⊢ a 2 = 5
apply a_eq_of 2 9 (by ⊢ IsSemiprime 9 ∧ Odd 9 native_decide All goals completed! 🐙) (by ⊢ 2 ^ 2 < 9 norm_num All goals completed! 🐙)
intro x h1 h2 x:ℕh1:2 ^ 2 < xh2:x < 9⊢ ¬(x.IsSemiprime ∧ Odd x)
interval_cases x «5» x:ℕh1:2 ^ 2 < 5h2:5 < 9⊢ ¬(IsSemiprime 5 ∧ Odd 5)«6» x:ℕh1:2 ^ 2 < 6h2:6 < 9⊢ ¬(IsSemiprime 6 ∧ Odd 6)«7» x:ℕh1:2 ^ 2 < 7h2:7 < 9⊢ ¬(IsSemiprime 7 ∧ Odd 7)«8» x:ℕh1:2 ^ 2 < 8h2:8 < 9⊢ ¬(IsSemiprime 8 ∧ Odd 8) <;> «5» x:ℕh1:2 ^ 2 < 5h2:5 < 9⊢ ¬(IsSemiprime 5 ∧ Odd 5)«6» x:ℕh1:2 ^ 2 < 6h2:6 < 9⊢ ¬(IsSemiprime 6 ∧ Odd 6)«7» x:ℕh1:2 ^ 2 < 7h2:7 < 9⊢ ¬(IsSemiprime 7 ∧ Odd 7)«8» x:ℕh1:2 ^ 2 < 8h2:8 < 9⊢ ¬(IsSemiprime 8 ∧ Odd 8) native_decide All goals completed! 🐙@[category test, AMS 11]
theorem a_3 : a 3 = 1 := by ⊢ a 3 = 1
apply a_eq_of 3 9 (by ⊢ IsSemiprime 9 ∧ Odd 9 native_decide All goals completed! 🐙) (by ⊢ 2 ^ 3 < 9 norm_num All goals completed! 🐙)
intro x h1 h2 x:ℕh1:2 ^ 3 < xh2:x < 9⊢ ¬(x.IsSemiprime ∧ Odd x)
interval_cases x All goals completed! 🐙@[category test, AMS 11]
theorem a_4 : a 4 = 5 := by ⊢ a 4 = 5
apply a_eq_of 4 21 (by ⊢ IsSemiprime 21 ∧ Odd 21 native_decide All goals completed! 🐙) (by ⊢ 2 ^ 4 < 21 norm_num All goals completed! 🐙)
intro x h1 h2 x:ℕh1:2 ^ 4 < xh2:x < 21⊢ ¬(x.IsSemiprime ∧ Odd x)
interval_cases x «17» x:ℕh1:2 ^ 4 < 17h2:17 < 21⊢ ¬(IsSemiprime 17 ∧ Odd 17)«18» x:ℕh1:2 ^ 4 < 18h2:18 < 21⊢ ¬(IsSemiprime 18 ∧ Odd 18)«19» x:ℕh1:2 ^ 4 < 19h2:19 < 21⊢ ¬(IsSemiprime 19 ∧ Odd 19)«20» x:ℕh1:2 ^ 4 < 20h2:20 < 21⊢ ¬(IsSemiprime 20 ∧ Odd 20) <;> «17» x:ℕh1:2 ^ 4 < 17h2:17 < 21⊢ ¬(IsSemiprime 17 ∧ Odd 17)«18» x:ℕh1:2 ^ 4 < 18h2:18 < 21⊢ ¬(IsSemiprime 18 ∧ Odd 18)«19» x:ℕh1:2 ^ 4 < 19h2:19 < 21⊢ ¬(IsSemiprime 19 ∧ Odd 19)«20» x:ℕh1:2 ^ 4 < 20h2:20 < 21⊢ ¬(IsSemiprime 20 ∧ Odd 20) native_decide All goals completed! 🐙@[category test, AMS 11]
theorem a_5 : a 5 = 1 := by ⊢ a 5 = 1
apply a_eq_of 5 33 (by ⊢ IsSemiprime 33 ∧ Odd 33 native_decide All goals completed! 🐙) (by ⊢ 2 ^ 5 < 33 norm_num All goals completed! 🐙)
intro x h1 h2 x:ℕh1:2 ^ 5 < xh2:x < 33⊢ ¬(x.IsSemiprime ∧ Odd x)
interval_cases x All goals completed! 🐙In this powers of 2 sequence, does 1 occur infinitely often?
@[category research open, AMS 11]
theorem conjecture1 :
answer(sorry) ↔ Set.Infinite {n : ℕ | a n = 1} := by ⊢ True ↔ {n | a n = 1}.Infinite
sorry All goals completed! 🐙Does every odd number occur?
@[category research open, AMS 11]
theorem conjecture2 :
answer(sorry) ↔ ∀ k : ℕ, Odd k → ∃ n : ℕ, a n = k := by ⊢ True ↔ ∀ (k : ℕ), Odd k → ∃ n, OeisA114137.a n = k
sorry All goals completed! 🐙end OeisA114137