{
  "id": "4964",
  "ident": "NS.04964",
  "slug": "oeis-157225",
  "title": "Representations as $p + 2^x + 7 \\cdot 2^y$ with $p \\equiv 5 \\pmod 6$",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "On Feb. 24, 2009, Zhi-Wei Sun conjectured that $a(n) = 0$ if and only if $n < 11$ or\n$n \\in \\{13, 16, 992\\}$; in other words, except for $25, 31, 1983$, any odd integer greater\nthan $20$ can be written as the sum of a prime congruent to $5 \\bmod 6$, a positive power of $2$\nand seven times a positive power of $2$.\n\nAnswer: false, for n = 716993899 we have a(n) = 0.\nSee T. Adamczewski, OEIS Open: How many conjectures can language models turn into theorems?,\n[arxiv/2608.11941](https://arxiv.org/pdf/2608.11941).",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA157225.conjecture",
  "statement_lean": "theorem conjecture :\n    ¬ ∀ n : ℕ, 0 < n → (a n = 0 ↔ n < 11 ∨ n = 13 ∨ n = 16 ∨ n = 992)",
  "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 as $p + 2^x + 7 \\cdot 2^y$ with $p \\equiv 5 \\pmod 6$\n\nNumber of ways to write the $n$-th positive odd integer in the form $p + 2^x + 7 \\cdot 2^y$\nwith $p$ a prime congruent to $5 \\bmod 6$ and $x, y$ positive integers.\n$$a(n) = \\left|\\left\\{(p, x, y) : p + 2^x + 7 \\cdot 2^y = 2n - 1 \\text{ with } p \\text{ prime},\np \\equiv 5 \\pmod 6, x, y \\in \\mathbb{Z}^+\\right\\}\\right|.$$\n\n*References:*\n- [A157225](https://oeis.org/A157225)\n- Z.-W. Sun, \"Mixed sums of primes and other terms\", arXiv preprint\n  [arXiv:0901.3075](https://arxiv.org/abs/0901.3075) [math.NT], 2009.-/\n\n@[expose] public section\n\nnamespace OeisA157225\n\n/-- Number of representations of $2n - 1$ as $p + 2^x + 7 \\cdot 2^y$ with $p \\equiv 5 \\pmod 6$. -/\ndef a (n : ℕ) : ℕ :=\n  if n = 0 then 0\n  else\n    let N := 2 * n - 1\n    ∑ x ∈ Finset.Icc 1 N,\n    ∑ y ∈ Finset.Icc 1 N,\n      if 2 ^ x + 7 * 2 ^ y < N ∧\n         (N - (2 ^ x + 7 * 2 ^ y)).Prime ∧\n         (N - (2 ^ x + 7 * 2 ^ y)) % 6 = 5 then 1 else 0\n\n/-- Value of the sequence `a` at 1. -/\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 0 := by decide\n\n/-- Value of the sequence `a` at 2. -/\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 0 := by decide\n\n/-- Value of the sequence `a` at 11. -/\n@[category test, AMS 11]\ntheorem a_11 : a 11 = 1 := by decide\n\n/-- Value of the sequence `a` at 12. -/\n@[category test, AMS 11]\ntheorem a_12 : a 12 = 1 := by decide\n\n/-- Value of the sequence `a` at 13. -/\n@[category test, AMS 11]\ntheorem a_13 : a 13 = 0 := by decide\n\n/-- Value of the sequence `a` at 14. -/\n@[category test, AMS 11]\ntheorem a_14 : a 14 = 2 := by decide\n\nset_option linter.style.formal_proof_palomar false in\n/--\nOn Feb. 24, 2009, Zhi-Wei Sun conjectured that $a(n) = 0$ if and only if $n < 11$ or\n$n \\in \\{13, 16, 992\\}$; in other words, except for $25, 31, 1983$, any odd integer greater\nthan $20$ can be written as the sum of a prime congruent to $5 \\bmod 6$, a positive power of $2$\nand seven times a positive power of $2$.\n\nAnswer: false, for n = 716993899 we have a(n) = 0.\nSee T. Adamczewski, OEIS Open: How many conjectures can language models turn into theorems?,\n[arxiv/2608.11941](https://arxiv.org/pdf/2608.11941).\n-/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/epoch-research/LeanOpenProblems-results/blob/main/runs/oeis-full-50usd-ant-j0j0g4uzligm1k41/oeis_157225_conjecture_0/Submission/Spec.lean\"]\ntheorem conjecture :\n    ¬ ∀ n : ℕ, 0 < n → (a n = 0 ↔ n < 11 ∨ n = 13 ∨ n = 16 ∨ n = 992) := by\n  sorry\n\nend OeisA157225\n",
  "statement_hash": "2f179c3ac440ecd573680e683bf9bab74e2c98ca2f5b12847b39c259cc0174d7",
  "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."
}