{
  "id": "5932",
  "ident": "NS.05932",
  "slug": "oeis-255916",
  "title": "Representations of $n$ as a sum of generalized heptagonal, octagonal, and nonagonal numbers",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Conjecture: $a(n) > 0$ for all $n$.\n- _Zhi-Wei Sun_",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA255916.conjecture_1",
  "statement_lean": "theorem conjecture_1 (n : ℕ) : 0 < a 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# Representations of $n$ as a sum of generalized heptagonal, octagonal, and nonagonal numbers\n\nThe sequence $a(n)$ counts the number of ways to write $n$ as the sum of a generalized heptagonal\nnumber $G_7(k) = \\frac{5k^2 - 3k}{2}$ ($k \\in \\mathbb{Z}$), an octagonal number\n$P_8(x) = x(3x - 2)$ ($x \\ge 0$), and a nonagonal number $P_9(y) = \\frac{y(7y - 5)}{2}$ ($y \\ge 0$).\n\n*References:*\n- [A255916](https://oeis.org/A255916)\n-/\n\n@[expose] public section\n\nnamespace OeisA255916\n\nopen Nat Finset\n\n/-- Number of ways to write $n$ as the sum of a generalized heptagonal number, an octagonal\nnumber, and a nonagonal number. -/\ndef a (n : ℕ) : ℕ :=\n  let nBound : ℕ := n + 1\n  ∑ i ∈ Finset.range (2 * n + 3),\n    let k : ℤ := (i : ℤ) - (n + 1 : ℤ)\n    ∑ x ∈ Finset.range nBound, ∑ y ∈ Finset.range nBound,\n      if Nat.generalizedPolygonalNumber 7 k + Nat.polygonalNumber 8 x + Nat.polygonalNumber 9 y = n\n      then 1 else 0\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 = 3 := by decide\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 3 := by decide\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 1 := by decide\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 1 := by decide\n\n/-- Predicate asserting that $n$ can be written as the sum of a generalized $m$-gonal number\nand two polygonal numbers $P_j$ and $P_k$. -/\ndef IsSumOfGmPjPk (m n j k : ℕ) : Prop :=\n  ∃ (z : ℤ) (x y : ℕ),\n    Nat.generalizedPolygonalNumber m z + Nat.polygonalNumber j x + Nat.polygonalNumber k y = n\n\n/-- The set of ordered pairs $(j, k)$ from part (i) of Sun's conjecture. -/\ndef sunPolygonalPairsSet1 : Finset (ℕ × ℕ) :=\n  let kValsJ3 : Finset ℕ := (Icc 3 19) ∪ (Icc 21 24) ∪ {26, 27, 29, 30}\n  let set3K := kValsJ3.image (fun k => (3, k))\n  let kValsJ4 : Finset ℕ := (Icc 4 11) ∪ {13, 14, 17, 19, 20, 23, 26}\n  let set4K := kValsJ4.image (fun k => (4, k))\n  set3K ∪ set4K ∪ {(5, 6), (5, 9), (6, 7), (8, 9)}\n\n/-- The set of ordered pairs $(j, k)$ from part (ii) of Sun's conjecture. -/\ndef sunPolygonalPairsSet2 : Finset (ℕ × ℕ) :=\n  let kValsJ3 : Finset ℕ := (Icc 3 20) ∪ {22, 24, 25} ∪ (Icc 28 30) ∪ {32, 37}\n  let set3K := kValsJ3.image (fun k => (3, k))\n  let kValsJ4 : Finset ℕ :=\n    (Icc 4 13) ∪ {15, 16, 18} ∪ (Icc 20 25) ∪ {27, 28, 31, 33, 34}\n  let set4K := kValsJ4.image (fun k => (4, k))\n  let kValsJ5 : Finset ℕ := (Icc 6 12) ∪ {20}\n  let set5K := kValsJ5.image (fun k => (5, k))\n  let kValsJ6 : Finset ℕ := Icc 7 10\n  let set6K := kValsJ6.image (fun k => (6, k))\n  set3K ∪ set4K ∪ set5K ∪ set6K ∪ {(7, 9), (7, 11), (8, 10), (9, 11)}\n\n/--\nConjecture: $a(n) > 0$ for all $n$.\n- _Zhi-Wei Sun_\n-/\n@[category research open, AMS 11]\ntheorem conjecture_1 (n : ℕ) : 0 < a n := by\n  sorry\n\n/--\nConjecture (i): For $k \\ge j \\ge 3$, every nonnegative integer can be written as the sum of a\ngeneralized heptagonal number, a $j$-gonal number and a $k$-gonal number, if and only if $(j, k)$\nis among the following ordered pairs:\n$(3, k)$ ($k = 3..19, 21..24, 26, 27, 29, 30$),\n$(4, k)$ ($k = 4..11, 13, 14, 17, 19, 20, 23, 26$),\n$(5, 6), (5, 9), (6, 7), (8, 9)$.\n- _Zhi-Wei Sun_\n-/\n@[category research open, AMS 11]\ntheorem conjecture_2 (j k : ℕ) (hjk : 3 ≤ j ∧ j ≤ k) :\n    (∀ n : ℕ, IsSumOfGmPjPk 7 n j k) ↔ (j, k) ∈ sunPolygonalPairsSet1 := by\n  sorry\n\n/--\nConjecture (ii): For $k \\ge j \\ge 3$, every nonnegative integer can be written as the sum of a\ngeneralized pentagonal number, a $j$-gonal number and a $k$-gonal number, if and only if $(j, k)$\nis among the following ordered pairs:\n$(3, k)$ ($k = 3..20, 22, 24, 25, 28..30, 32, 37$),\n$(4, k)$ ($k = 4..13, 15, 16, 18, 20..25, 27, 28, 31, 33, 34$),\n$(5, k)$ ($k = 6..12, 20$), $(6, k)$ ($k = 7..10$), $(7, 9), (7, 11), (8, 10), (9, 11)$.\n- _Zhi-Wei Sun_\n-/\n@[category research open, AMS 11]\ntheorem conjecture_3 (j k : ℕ) (hjk : 3 ≤ j ∧ j ≤ k) :\n    (∀ n : ℕ, IsSumOfGmPjPk 5 n j k) ↔ (j, k) ∈ sunPolygonalPairsSet2 := by\n  sorry\n\nend OeisA255916\n",
  "statement_hash": "343e1a4e6bf541323e4a68acc5a5cde1723b4141765e42009a6f9bef736ace37",
  "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."
}