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

A self-compositional exponential generating function

The normalized exponential generating function of OEIS A368630 satisfies $A(x/A(x)^2)=\exp(xA(x))$, with $A(0)=1$.

References:

@[expose] public sectionnamespace OeisA368630open PowerSeries

The rational exponential generating series of an integer sequence.

noncomputable def egf (a : ℕ → ℤ) : ℚ⟦X⟧ := PowerSeries.mk fun n => (a n : ℚ) / n.factorial

The defining equation for the integer EGF coefficients of OEIS A368630.

def IsGeneratingSequence (c : ℕ → ℤ) : Prop := (egf c).constantCoeff = 1 ∧ (egf c).subst (X * ((egf c)⁻¹) ^ 2) = (exp ℚ).subst (X * egf c)

The integer coefficients of the normalized exponential generating function.

noncomputable def a : ℕ → ℤ := Classical.epsilon IsGeneratingSequence

The original equation defines a unique integer coefficient sequence; see [Li26].

@[category API, AMS 11 13, formal_proof using lean4 at "https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-13-000013"] theorem exists_unique_sequence : ∃! c : ℕ → ℤ, IsGeneratingSequence c := ⊢ ∃! c, IsGeneratingSequence c All goals completed! 🐙

The selected sequence satisfies the defining equation.

@[category API, AMS 11 13] theorem a_spec : IsGeneratingSequence a := Classical.epsilon_spec exists_unique_sequence.exists@[category test, AMS 11] theorem a_0 : a 0 = 1 := ⊢ a 0 = 1 h:constantCoeff (egf a) = 1⊢ a 0 = 1 h:a 0 = 1⊢ a 0 = 1 All goals completed! 🐙@[category test, AMS 11] theorem a_1 : a 1 = 1 := ⊢ a 1 = 1 All goals completed! 🐙@[category test, AMS 11] theorem a_2 : a 2 = 7 := ⊢ a 2 = 7 All goals completed! 🐙@[category test, AMS 11] theorem a_3 : a 3 = 136 := ⊢ a 3 = 136 All goals completed! 🐙@[category test, AMS 11] theorem a_4 : a 4 = 4933 := ⊢ a 4 = 4933 All goals completed! 🐙

For every $n \ge 0$, "a(n) == 1 (mod 3)".

    Paul D. Hanna, Jan 02 2024.

Proved by Wentao Li with OpenAI Codex assistance; see [Li26].

@[category research solved, AMS 11, formal_proof using lean4 at "https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-13-000013"] theorem conjecture_mod_three (n : ℕ) : a n % 3 = 1 := n:ℕ⊢ a n % 3 = 1 All goals completed! 🐙

For every $n \ge 0$, "a(2*n) == 1 (mod 2)".

    Paul D. Hanna, Jan 02 2024.

Proved by Wentao Li with OpenAI Codex assistance; see [Li26].

@[category research solved, AMS 11, formal_proof using lean4 at "https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-13-000013"] theorem conjecture_even (n : ℕ) : a (2 * n) % 2 = 1 := n:ℕ⊢ a (2 * n) % 2 = 1 All goals completed! 🐙

For every $n \ge 1$, "a(2*n+1) == 0 (mod 2)". The term $a(1)=1$ is excluded.

    Paul D. Hanna, Jan 02 2024.

Proved by Wentao Li with OpenAI Codex assistance; see [Li26].

@[category research solved, AMS 11, formal_proof using lean4 at "https://palomar-registry.org/entry.html?id=PALOMAR-2026-11-13-000013"] theorem conjecture_odd (n : ℕ) (hn : 1 ≤ n) : a (2 * n + 1) % 2 = 0 := n:ℕhn:1 ≤ n⊢ a (2 * n + 1) % 2 = 0 All goals completed! 🐙end OeisA368630