{
  "id": "6623",
  "ident": "NS.06623",
  "slug": "oeis-52709",
  "title": "Expansion of g.f. $(1-\\sqrt{1-4x-4x^2})/(2(1+x))$",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Conjecture: for $n > 0$, $a(n)$ is also the number of sequences of length $n - 1$ covering an\ninitial interval of positive integers and avoiding three terms\n$(\\dots, x, \\dots, y, \\dots, z, \\dots)$ such that $x \\le y \\le z$.\n- Gus Wiseman, Jun 17 2021",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA52709.conjecture",
  "statement_lean": "theorem conjecture (n : ℕ) (hn : 0 < n) [Fintype (sequencesCountedByA052709 n)] :\n    a n = Fintype.card (sequencesCountedByA052709 n)",
  "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# Expansion of g.f. $(1-\\sqrt{1-4x-4x^2})/(2(1+x))$\n\nThe $n$-th term $a(n)$ is given by\n$$a(n) = \\sum_{k=0}^{n-1} \\frac{1}{k+1} \\binom{2k}{k} \\binom{k}{n-1-k}$$\n\n*References:*\n- [A052709](https://oeis.org/A052709)-/\n\n@[expose] public section\n\nnamespace OeisA52709\n\n/-- $a(n) = \\sum_{k=0}^{n-1} \\frac{1}{k+1} \\binom{2k}{k} \\binom{k}{n-1-k}$. -/\ndef a (n : ℕ) : ℕ :=\n  ∑ k ∈ Finset.range n, ((Nat.choose (2 * k) k) / (k + 1)) * (Nat.choose k (n - 1 - k))\n\n@[category test, AMS 5 11]\ntheorem a_0 : a 0 = 0 := by\n  decide\n\n@[category test, AMS 5 11]\ntheorem a_1 : a 1 = 1 := by\n  decide\n\n@[category test, AMS 5 11]\ntheorem a_2 : a 2 = 1 := by\n  decide\n\n@[category test, AMS 5 11]\ntheorem a_3 : a 3 = 3 := by\n  decide\n\n@[category test, AMS 5 11]\ntheorem a_4 : a 4 = 9 := by\n  decide\n\n@[category test, AMS 5 11]\ntheorem a_5 : a 5 = 31 := by\n  decide\n\n/-- A list of natural numbers is composed of positive integers. -/\ndef isPositiveList (l : List ℕ) : Prop :=\n  ∀ x ∈ l, 0 < x\n\n/-- A list covers an initial interval of positive integers if the set of\n    its elements is $\\{1, 2, \\dots, \\max(l)\\}$. -/\ndef coversInitialInterval (l : List ℕ) : Prop :=\n  isPositiveList l ∧\n  let s := l.toFinset\n  match s.max with\n  | some max_s => ∀ m : ℕ, 0 < m → (m ∈ s ↔ m ≤ max_s)\n  | none => l.isEmpty\n\n/-- A list has a non-decreasing subsequence of length 3 (the pattern $x \\le y \\le z$). -/\ndef hasNondecreasingPattern3 (l : List ℕ) : Prop :=\n  ∃ (i j k : Fin l.length),\n    i < j ∧ j < k ∧ l.get i ≤ l.get j ∧ l.get j ≤ l.get k\n\n/-- A list avoids the pattern $x \\le y \\le z$ if it does not have a non-decreasing\nsubsequence of length 3. -/\ndef avoidsPatternXYZ (l : List ℕ) : Prop :=\n  ¬ hasNondecreasingPattern3 l\n\n/-- The set of sequences of length $n-1$ satisfying the conditions of the conjecture. -/\ndef sequencesCountedByA052709 (n : ℕ) : Set (List ℕ) :=\n  { l : List ℕ | l.length = n - 1 ∧ coversInitialInterval l ∧ avoidsPatternXYZ l }\n\nset_option linter.style.formal_proof_palomar false in\n/--\nConjecture: for $n > 0$, $a(n)$ is also the number of sequences of length $n - 1$ covering an\ninitial interval of positive integers and avoiding three terms\n$(\\dots, x, \\dots, y, \\dots, z, \\dots)$ such that $x \\le y \\le z$.\n- Gus Wiseman, Jun 17 2021\n-/\n@[category research solved, AMS 5 11,\n  formal_proof using lean4 at \"https://github.com/epoch-research/LeanOpenProblems-results/blob/f02efd9a8c5fc6a735d2a90c33e24f7278ce0ffc/runs/oeis-full-50usd-ant-j0j0g4uzligm1k41/oeis_52709_conjecture_0/Submission/Spec.lean#L1289\"]\ntheorem conjecture (n : ℕ) (hn : 0 < n) [Fintype (sequencesCountedByA052709 n)] :\n    a n = Fintype.card (sequencesCountedByA052709 n) := by\n  sorry\n\nend OeisA52709\n",
  "statement_hash": "a99e7fb38e093b363eb09f974156e8651afef73efb89af323bd0c79dd658448e",
  "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."
}