{
  "id": "5952",
  "ident": "NS.05952",
  "slug": "oeis-258667",
  "title": "Asymptotics of an inner sum formula for $a(n)$",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Conjecture: $a(n) \\sim e^{-2} \\cdot n! / (n-2)$.\n\nA formal proof has been found with the methods described in\n[arxiv/2605.22763](https://arxiv.org/abs/2605.22763).",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA258667.a_is_equivalent_asymptoticTerm",
  "statement_lean": "theorem a_is_equivalent_asymptoticTerm :\n    IsEquivalent atTop (fun n : ℕ => (a n : ℝ)) asymptoticTerm",
  "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# Asymptotics of an inner sum formula for $a(n)$\n\nThe inner sum of the formula used in a:\n$$\\sum_{\\max(k-n+5, 0) \\le j \\le \\min(k,4)} \\binom{8-j}{j}\\binom{2n-k+j-10}{k-j}$$\n\na: A total of $n$ married couples, including a mathematician M and his wife, are to be seated\nat the $2n$ chairs around a circular table, with no man seated next to his wife. After the ladies\nare seated at every other chair, M is the first man allowed to choose one of the remaining chairs.\nThe sequence gives the number of ways of seating the other men, with no man seated next to his\nwife, if M chooses the chair that is 9 seats clockwise from his wife's chair.\n\n$$a(n) = \\begin{cases} 0 & \\text{if } n \\le 5 \\cr\n\\sum_{k=0}^{n-1}(-1)^k(n-k-1)! \\sum_{\\max(k-n+5, 0) \\le j \\le \\min(k,4)}\n\\binom{8-j}{j}\\binom{2n-k+j-10}{k-j} & \\text{if } n > 5 \\end{cases}$$\n\n*References:*\n- [A258667](https://oeis.org/A258667)\n- [arxiv/2605.22763](https://arxiv.org/abs/2605.22763) *Advancing Mathematics Research with AI-Driven Formal Proof Search* by George Tsoukalas et al.\n-/\n\n@[expose] public section\n\nnamespace OeisA258667\n\n\nopen scoped Topology\n\nopen BigOperators Nat Int Real Asymptotics Filter\n\n/--\nThe inner sum of the formula used in a:\n$$\\sum_{\\max(k-n+5, 0) \\le j \\le \\min(k,4)} \\binom{8-j}{j}\\binom{2n-k+j-10}{k-j}$$\n-/\ndef inner_sum (n k : ℕ) : ℤ :=\n  let L : ℕ := max 0 (k + 5 - n)\n  let U : ℕ := min k 4\n  Finset.sum (Finset.Icc L U) fun j =>\n    let term1 := Nat.choose (8 - j) j\n    -- The top argument of the second binomial coefficient is written in Nat subtraction form.\n    let term2 := Nat.choose (2 * n + j - (k + 10)) (k - j)\n    ofNat term1 * ofNat term2\n\n/--\na: A total of $n$ married couples, including a mathematician M and his wife, are to be seated\nat the $2n$ chairs around a circular table, with no man seated next to his wife. After the ladies\nare seated at every other chair, M is the first man allowed to choose one of the remaining chairs.\nThe sequence gives the number of ways of seating the other men, with no man seated next to his\nwife, if M chooses the chair that is 9 seats clockwise from his wife's chair.\n\n$$a(n) = \\begin{cases} 0 & \\text{if } n \\le 5 \\cr\n\\sum_{k=0}^{n-1}(-1)^k(n-k-1)! \\sum_{\\max(k-n+5, 0) \\le j \\le \\min(k,4)}\n\\binom{8-j}{j}\\binom{2n-k+j-10}{k-j} & \\text{if } n > 5 \\end{cases}$$\n-/\ndef a (n : ℕ) : ℕ :=\n  if n ≤ 5 then 0 else\n  (Finset.sum (Finset.range n) fun k =>\n    let sign : ℤ := if k % 2 = 0 then 1 else -1\n    -- Nat.factorial (n - 1 - k) is safe since h implies n > 5 and k < n.\n    let fac_term : ℤ := ofNat (Nat.factorial (n - 1 - k))\n\n    sign * fac_term * inner_sum n k\n  ).natAbs\n\nnoncomputable def natFacToReal (n : ℕ) : ℝ := (Nat.factorial n : ℝ)\n\n/-- The denominator term $k! (n-1)_k$ represented as a Real number. -/\nnoncomputable def menageDenomTerm (n k : ℕ) : ℝ :=\n  let k_fac_R := natFacToReal k\n  -- (n-1)_k is the falling factorial. Nat.descFactorial (n-1) k is (n-1)!/(n-1-k)!\n  let falling_fac := (Nat.descFactorial (n - 1) k : ℝ)\n  k_fac_R * falling_fac\n\n/-- The infinite series part of the asymptotic expansion:\n$\\sum_{k \\ge 1} \\frac{(-1)^k}{k!(n-1)_k}$. -/\nnoncomputable def asymptoticSumPart (n : ℕ) : ℝ :=\n  -- The sum is effectively finite since (n-1)_k is 0 for k >= n.\n  Finset.sum (Finset.range n) fun k =>\n    if k = 0 then 0\n    else\n      let denom := menageDenomTerm n k\n      -- Denominator is non-zero if n >= 1 and 1 <= k < n.\n      if denom = 0 then 0\n      else ((-1 : ℝ) ^ k) / denom\n\n/-- The proposed asymptotic expression for a(n). -/\nnoncomputable def asymptoticTerm (n : ℕ) : ℝ :=\n  if n ≤ 2 then 0 -- Avoid division by zero, irrelevant for n -> infinity\n  else\n    let n_R : ℝ := n\n    let n_fac_R := natFacToReal n\n    let prefactor : ℝ := exp (-2) * (n_fac_R / (n_R - 2))\n    prefactor * (1 + asymptoticSumPart n)\n\n\n@[category test, AMS 11]\nlemma a_1 : a 1 = 0 := by rfl\n\n@[category test, AMS 11]\nlemma a_2 : a 2 = 0 := by rfl\n\n@[category test, AMS 11]\nlemma a_3 : a 3 = 0 := by rfl\n\n@[category test, AMS 11]\nlemma a_4 : a 4 = 0 := by rfl\n\n@[category test, AMS 11]\nlemma a_5 : a 5 = 0 := by rfl\n\n\nset_option linter.style.formal_proof_palomar false in\n/--\nConjecture: $a(n) \\sim e^{-2} \\cdot n! / (n-2)$.\n\nA formal proof has been found with the methods described in\n[arxiv/2605.22763](https://arxiv.org/abs/2605.22763).\n-/\n@[category research solved, AMS 11, formal_proof using formal_conjectures at\n\"https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/258667.wip.lean#L427\"]\ntheorem a_is_equivalent_asymptoticTerm :\n    IsEquivalent atTop (fun n : ℕ => (a n : ℝ)) asymptoticTerm := by\n    sorry\n\nend OeisA258667\n",
  "statement_hash": "c4f9ab875102eee6e092f432e85f361ffd6244d974af2ea2df6e0841b10dbfb0",
  "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."
}