/-
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 OeisA108569open scoped NatThe predicate defining whether $k$ belongs to the sequence.
def A (k : ℕ) : Prop := 0 < k ∧ φ k = φ (k + φ k)instance : DecidablePred A := ⊢ DecidablePred A
⊢ DecidablePred fun k ↦ 0 < k ∧ φ k = φ (k + φ k)
All goals completed! 🐙
The primary defining sequence a.
a n is the $(n+1)$-th positive integer $k$ such that $\phi(k) = \phi(k + \phi(k))$.
noncomputable def a (n : ℕ) : ℕ :=
n.nth ATerm theorems verifying the first few values of the sequence against the official OEIS b-file
h1:A 1hcnt:Nat.count A 1 = 0⊢ a 0 = 1
have := Nat.nth_count (p := A) h1 h1:A 1hcnt:Nat.count A 1 = 0this:Nat.nth A (Nat.count A 1) = 1⊢ a 0 = 1
rwa [hcnt h1:A 1hcnt:Nat.count A 1 = 0this:Nat.nth A 0 = 1⊢ a 0 = 1] h1:A 1hcnt:Nat.count A 1 = 0this:Nat.nth A 0 = 1⊢ a 0 = 1 at this
@[category test, AMS 11]
theorem a_1 : a 1 = 4 := by ⊢ a 1 = 4
have h4 : A 4 := by decide h4:A 4⊢ a 1 = 4 h4:A 4⊢ a 1 = 4
have hcnt : Nat.count A 4 = 1 := by decide h4:A 4hcnt:Nat.count A 4 = 1⊢ a 1 = 4 h4:A 4hcnt:Nat.count A 4 = 1⊢ a 1 = 4
have := Nat.nth_count (p := A) h4 h4:A 4hcnt:Nat.count A 4 = 1this:Nat.nth A (Nat.count A 4) = 4⊢ a 1 = 4
rwa [hcnt h4:A 4hcnt:Nat.count A 4 = 1this:Nat.nth A 1 = 4⊢ a 1 = 4] h4:A 4hcnt:Nat.count A 4 = 1this:Nat.nth A 1 = 4⊢ a 1 = 4 at this
@[category test, AMS 11]
theorem a_2 : a 2 = 8 := by ⊢ a 2 = 8
have h8 : A 8 := by decide h8:A 8⊢ a 2 = 8 h8:A 8⊢ a 2 = 8
have hcnt : Nat.count A 8 = 2 := by decide h8:A 8hcnt:Nat.count A 8 = 2⊢ a 2 = 8 h8:A 8hcnt:Nat.count A 8 = 2⊢ a 2 = 8
have := Nat.nth_count (p := A) h8 h8:A 8hcnt:Nat.count A 8 = 2this:Nat.nth A (Nat.count A 8) = 8⊢ a 2 = 8
rwa [hcnt h8:A 8hcnt:Nat.count A 8 = 2this:Nat.nth A 2 = 8⊢ a 2 = 8] h8:A 8hcnt:Nat.count A 8 = 2this:Nat.nth A 2 = 8⊢ a 2 = 8 at this
@[category test, AMS 11]
theorem a_3 : a 3 = 16 := by ⊢ a 3 = 16
have h16 : A 16 := by decide h16:A 16⊢ a 3 = 16 h16:A 16⊢ a 3 = 16
have hcnt : Nat.count A 16 = 3 := by decide h16:A 16hcnt:Nat.count A 16 = 3⊢ a 3 = 16 h16:A 16hcnt:Nat.count A 16 = 3⊢ a 3 = 16
have := Nat.nth_count (p := A) h16 h16:A 16hcnt:Nat.count A 16 = 3this:Nat.nth A (Nat.count A 16) = 16⊢ a 3 = 16
rwa [hcnt h16:A 16hcnt:Nat.count A 16 = 3this:Nat.nth A 3 = 16⊢ a 3 = 16] h16:A 16hcnt:Nat.count A 16 = 3this:Nat.nth A 3 = 16⊢ a 3 = 16 at this
@[category test, AMS 11]
theorem a_4 : a 4 = 32 := by ⊢ a 4 = 32
have h32 : A 32 := by decide h32:A 32⊢ a 4 = 32 h32:A 32⊢ a 4 = 32
have hcnt : Nat.count A 32 = 4 := by decide h32:A 32hcnt:Nat.count A 32 = 4⊢ a 4 = 32 h32:A 32hcnt:Nat.count A 32 = 4⊢ a 4 = 32
have := Nat.nth_count (p := A) h32 h32:A 32hcnt:Nat.count A 32 = 4this:Nat.nth A (Nat.count A 32) = 32⊢ a 4 = 32
rwa [hcnt h32:A 32hcnt:Nat.count A 32 = 4this:Nat.nth A 4 = 32⊢ a 4 = 32] h32:A 32hcnt:Nat.count A 32 = 4this:Nat.nth A 4 = 32⊢ a 4 = 32 at thisConjecture: Except for the first term all terms are even.
@[category research open, AMS 11]
theorem conjecture : ∀ n, 0 < n → Even (a n) := by ⊢ ∀ (n : ℕ), 0 < n → Even (OeisA108569.a n)
sorry All goals completed! 🐙end OeisA108569