{
  "id": "5990",
  "ident": "NS.05990",
  "slug": "oeis-261680",
  "title": "Sums of four binary palindromes",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Every number is the sum of four binary palindromes, i.e., $a(n) > 0$ for all $n$.\nOriginally stated as a conjecture on OEIS; proved by Rajasekaran, Shallit, and Smith (2017).",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA261680.conjecture",
  "statement_lean": "theorem conjecture (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# Sums of four binary palindromes\n\nNumber of ordered quadruples $(u, v, w, x)$ of binary palindromes (see A006995) with\n$u + v + w + x = n$.\n\n*References:*\n- [A261680](https://oeis.org/A261680)\n- [Sums of Palindromes: an Approach via Nested-Word Automata](https://arxiv.org/abs/1706.10206)\n  by *Aayush Rajasekaran*, *Jeffrey Shallit*, and *Tim Smith*, arXiv:1706.10206 (2017)\n-/\n\n@[expose] public section\n\nnamespace OeisA261680\n\n/-- Whether $k$ is a binary palindrome (A006995). -/\ndef isBinaryPalindrome (k : ℕ) : Bool :=\n  (Nat.digits 2 k).reverse == Nat.digits 2 k\n\n/--\nThe number of ordered quadruples $(u, v, w, x)$ of binary palindromes with $u + v + w + x = n$.\n-/\ndef a (n : ℕ) : ℕ :=\n  ∑ u ∈ Finset.range (n + 1),\n    ∑ v ∈ Finset.range (n - u + 1),\n      ∑ w ∈ Finset.range (n - (u + v) + 1),\n        let x := n - (u + v + w)\n        if isBinaryPalindrome u &&\n           isBinaryPalindrome v &&\n           isBinaryPalindrome w &&\n           isBinaryPalindrome x\n        then 1 else 0\n\n@[category test, AMS 11]\ntheorem a_0 : a 0 = 1 := by rfl\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 4 := by rfl\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 6 := by rfl\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 8 := by rfl\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 13 := by rfl\n\n/--\nEvery number is the sum of four binary palindromes, i.e., $a(n) > 0$ for all $n$.\nOriginally stated as a conjecture on OEIS; proved by Rajasekaran, Shallit, and Smith (2017).\n-/\n@[category research solved, AMS 11]\ntheorem conjecture (n : ℕ) : 0 < a n := by\n  sorry\n\nend OeisA261680\n",
  "statement_hash": "74a18b2d724b9fc5990fa3b62d817a56d54b39d196eecbfc9543725b8fd81d26",
  "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."
}