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

Combinatorial representation of the recurrence $a(n+2) = 2a(n+1) + 2a(n)$

A028859 (OEIS): $a(n+2) = 2 \cdot a(n+1) + 2 \cdot a(n)$; $a(0) = 1$, $a(1) = 3$.

References:

    A028859

    arxiv/2605.22763 Advancing Mathematics Research with AI-Driven Formal Proof Search by George Tsoukalas et al.

namespace OeisA28859

A028859 (OEIS): $a(n+2) = 2 \cdot a(n+1) + 2 \cdot a(n)$; $a(0) = 1$, $a(1) = 3$.

def a (n : ) : := match n with | 0 => 1 | 1 => 3 | (n + 2) => 2 * a (n + 1) + 2 * a n termination_by nset_option linter.unusedVariables false@[category test, AMS 11] lemma a_0 : a 0 = 1 := a 0 = 1 All goals completed! 🐙@[category test, AMS 11] lemma a_1 : a 1 = 3 := a 1 = 3 All goals completed! 🐙@[category test, AMS 11] lemma a_2 : a 2 = 8 := a 2 = 8 All goals completed! 🐙@[category test, AMS 11] lemma a_3 : a 3 = 22 := a 3 = 22 All goals completed! 🐙@[category test, AMS 11] lemma a_4 : a 4 = 60 := a 4 = 60 All goals completed! 🐙

Conjecture: The sequence a(n) is also the number of compositions of $n$ into positive integers such that adjacent parts and the largest part differ by at most 1. - Gus Wiseman, May 19 2020

A formal proof has been found with the methods described in arxiv/2605.22763.

@[category research solved, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/28859.wip.lean#L402"] theorem exists_finset_sequence (n : ) : let L := n + 1 let Sequence := Fin L let S : Set Sequence := {σ : Sequence | L > 0 ( i : Fin L, σ i > 0) let max_val := Finset.sup Finset.univ σ ( k : , 1 k k max_val i : Fin L, σ i = k) ( i j : Fin L, i < j j.val i.val + 1 σ i σ j)} (F : Finset Sequence), (F : Set Sequence) = S F.card = a n := n:let L := n + 1; let Sequence := Fin L ; let S := {σ | L > 0 (∀ (i : Fin L), σ i > 0) let max_val := Finset.univ.sup σ; (∀ (k : ), 1 k k max_val i, σ i = k) (i j : Fin L), i < j j i + 1 σ i σ j}; F, F = S F.card = a n All goals completed! 🐙end OeisA28859