{
  "id": "4606",
  "ident": "NS.04606",
  "slug": "oeis-108306",
  "title": "A108306: Expansion of $(3x+1)/(1-3x-3x^2)$",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "The conjecture: The INVERT transform of a sequence starting\n$(1, a, ab, ab^2, ab^3, \\ldots)$ is equivalent to extracting the upper left terms\nof powers of the 2x2 matrix [(1,a); (1,b)].",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA108306.conjecture",
  "statement_lean": "theorem conjecture (a_val b_val n : ℕ) :\n    invertSeqD a_val b_val n = (genMatrix a_val b_val ^ n) 0 0",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# A108306: Expansion of $(3x+1)/(1-3x-3x^2)$\n\nThis sequence satisfies the linear recurrence relation $a(0)=1$, $a(1)=6$,\nand $a(n) = 3a(n-1) + 3a(n-2)$ for $n \\ge 2$.\n\n*References:*\n- [A108306](https://oeis.org/A108306)\n-/\n\n@[expose] public section\n\nnamespace OeisA108306\n\n/-- The primary defining sequence `a`.\n`a n` is the $n$-th term of the expansion of $(3x+1)/(1-3x-3x^2)$,\nsatisfying $a(0)=1, a(1)=6, a(n)=3a(n-1)+3a(n-2)$. -/\ndef a : ℕ → ℕ\n  | 0 => 1\n  | 1 => 6\n  | k + 2 => 3 * a (k + 1) + 3 * a k\n\n@[category test, AMS 11]\ntheorem a_0 : a 0 = 1 := by decide\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 6 := by decide\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 21 := by decide\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 81 := by decide\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 306 := by decide\n\nopen Matrix\n\n/--\nThe matrix for the specific case $a=5, b=2$.\n$$M = \\begin{pmatrix} 1 & 5 \\cr 1 & 2 \\end{pmatrix}$$\n-/\ndef m : Matrix (Fin 2) (Fin 2) ℕ :=\n  fun i j => match i, j with\n  | 0, 0 => 1\n  | 0, 1 => 5\n  | 1, 0 => 1\n  | 1, 1 => 2\n\n/--\nThe sequence is the INVERT transform of (1, 5, 10, 20, 40, 80, 160, ...) and can be obtained\nby extracting the upper left terms of matrix powers of [(1,5); (1,2)].\nThese results are a case (a=5, b=2) of the general conjecture below.\n-/\n@[category textbook, AMS 11]\ntheorem a_is_invert_transform_case (n : ℕ) :\n    a n = (m ^ (n + 1)) 0 0 := by\n  -- `m` satisfies `m ^ 2 = 3 m + 3`, so its powers satisfy the recurrence of `a`.\n  have hm : ∀ n, m ^ (n + 2) = 3 • m ^ (n + 1) + 3 • m ^ n := fun n => by\n    rw [pow_add, show m ^ 2 = 3 • m + 3 • (1 : Matrix (Fin 2) (Fin 2) ℕ) by decide, mul_add,\n      mul_smul_comm, mul_smul_comm, mul_one, ← pow_succ]\n  induction n using Nat.twoStepInduction with\n  | zero => decide\n  | one => decide\n  | more k ih1 ih2 =>\n    rw [a, ih1, ih2, show k + 2 + 1 = k + 1 + 2 by omega, hm (k + 1)]\n    simp only [Matrix.add_apply, Matrix.smul_apply, smul_eq_mul]\n\n/--\nThe c sequence for the general INVERT transform conjecture.\n$c(1) = 1$, $c(k)=ab^(k-2)$ for $k \\ge 2$.\n-/\ndef invertSeqC (a b : ℕ) : ℕ → ℕ\n  | 0 => 0\n  | 1 => 1\n  | (k + 2) => a * b^k\n\n/-- The INVERT transform of the sequence c. -/\nnoncomputable def invertSeqD (a b : ℕ) (n : ℕ) : ℕ :=\n  Nat.strongRecOn n\n    (fun m ih =>\n      if m = 0 then 1\n      else ∑ i ∈ Finset.range m,\n        if h : i < m then invertSeqC a b (m - i) * ih i h else 0)\n\n/-- The general 2x2 matrix [(1,a); (1,b)]. -/\ndef genMatrix (a b : ℕ) : Matrix (Fin 2) (Fin 2) ℕ :=\n  fun i j => match i, j with\n  | 0, 0 => 1\n  | 0, 1 => a\n  | 1, 0 => 1\n  | 1, 1 => b\n\nset_option linter.style.formal_proof_palomar false in\n/--\nThe conjecture: The INVERT transform of a sequence starting\n$(1, a, ab, ab^2, ab^3, \\ldots)$ is equivalent to extracting the upper left terms\nof powers of the 2x2 matrix [(1,a); (1,b)].\n-/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/oeis-108306/blob/2e01e81b20a56880993e174ee4af0f0d7af37bdd/lean/OeisA108306FC.lean#L101-L106\"]\ntheorem conjecture (a_val b_val n : ℕ) :\n    invertSeqD a_val b_val n = (genMatrix a_val b_val ^ n) 0 0 := by\n  sorry\n\nend OeisA108306\n",
  "statement_hash": "49c6345c27ef415c19187bc85834518b72ea6c9e0f6f79875d6966b06603a534",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}