{
  "id": "6146",
  "ident": "NS.06146",
  "slug": "oeis-303639--conjecture-counterexample",
  "title": "Sum of two squares and two central-binomial-type terms · conjecture.counterexample",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "The counterexample witnessing that A303639 vanishes: $a(800322180) = 0$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA303639.conjecture.counterexample",
  "statement_lean": "theorem conjecture.counterexample : ¬ A 800322180",
  "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# Sum of two squares and two central-binomial-type terms\n\nA303639 counts the ways to write $n$ as $a^2 + b^2 + \\binom{2c+1}{c} + \\binom{2d+1}{d}$ with\n$a, b, c, d$ nonnegative integers, $a \\le b$ and $c \\le d$.\n\n*References:*\n- [A303639](https://oeis.org/A303639)\n- Z.-W. Sun, [\"Restricted sums of four squares\"](https://arxiv.org/abs/1701.05868),\n  arXiv:1701.05868 [math.NT], 2017-2018.\n- Z.-W. Sun, [\"Refining Lagrange's four-square theorem\"](https://doi.org/10.1016/j.jnt.2016.11.008),\n  *J. Number Theory* **175** (2017), 167-190.\n- S. Jeong, [A303639 Counterexample Project](https://github.com/DCLXAI/a303639-counterexample),\n  search, certificates and independent verifiers,\n  [DOI 10.5281/zenodo.21863025](https://doi.org/10.5281/zenodo.21863025). The counterexample is\n  recorded as an approved comment on the OEIS entry (Aug 10 2026).\n-/\n\n@[expose] public section\n\nnamespace OeisA303639\n\n/-- The predicate that $n$ can be written as $a^2 + b^2 + \\binom{2c+1}{c} + \\binom{2d+1}{d}$\nfor nonnegative integers $a, b, c, d$.\n\nThis drops the normalisations $a \\le b$ and $c \\le d$. They do not affect whether the count is\npositive, and refuting the unordered statement is the stronger result, since a representation\nwith $a \\le b$ and $c \\le d$ is in particular a representation. -/\ndef A (n : ℕ) : Prop :=\n  ∃ a b c d : ℕ, n = a ^ 2 + b ^ 2 + (2 * c + 1).choose c + (2 * d + 1).choose d\n\n@[category test, AMS 11]\ntheorem a_1 : ¬ A 1 := by\n  rintro ⟨a, b, c, d, h⟩\n  have hc : 0 < (2 * c + 1).choose c := Nat.choose_pos (by omega)\n  have hd : 0 < (2 * d + 1).choose d := Nat.choose_pos (by omega)\n  omega\n\n@[category test, AMS 11]\ntheorem a_2 : A 2 :=\n  ⟨0, 0, 0, 0, by decide⟩\n\n@[category test, AMS 11]\ntheorem a_3 : A 3 :=\n  ⟨1, 0, 0, 0, by decide⟩\n\n@[category test, AMS 11]\ntheorem a_4 : A 4 :=\n  ⟨0, 0, 0, 1, by decide⟩\n\n@[category test, AMS 11]\ntheorem a_5 : A 5 :=\n  ⟨1, 0, 0, 1, by decide⟩\n\n@[category test, AMS 11]\ntheorem a_6 : A 6 :=\n  ⟨2, 0, 0, 0, by decide⟩\n\nset_option linter.style.formal_proof_palomar false in\n/--\n**Zhi-Wei Sun's Conjecture (A303639)**: any integer $n > 1$ can be written as\n$a^2 + b^2 + \\binom{2c+1}{c} + \\binom{2d+1}{d}$ with $a, b, c, d$ nonnegative integers.\nSun checked this for $n$ up to $6 \\cdot 10^8$.\n\nThis is false: $n = 800322180$ admits no such representation, so $a(800322180) = 0$. Since\n$\\binom{33}{16} > 800322180$, only $c, d \\le 15$ are possible, and each of the resulting $136$\nremainders $800322180 - \\binom{2c+1}{c} - \\binom{2d+1}{d}$ is divisible by some prime\n$p \\equiv 3 \\pmod 4$ to an odd power, hence is not a sum of two squares by Fermat's two-square\ntheorem.\n\nThe counterexample is recorded as an approved comment on the OEIS entry; the Lean proof linked\nbelow formalises this argument, and was produced by Claude Opus 5 prompted by Sunsu Jeong\n([DCLXAI](https://github.com/DCLXAI)).\n-/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at \"https://github.com/DCLXAI/a303639-counterexample/blob/8e21c57c622b05a1815bcf9927458ebb3973ef2e/lean/A303639/Counterexample.lean\"]\ntheorem conjecture : ¬ ∀ n : ℕ, 1 < n → A n := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- The counterexample witnessing that A303639 vanishes: $a(800322180) = 0$. -/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at \"https://github.com/DCLXAI/a303639-counterexample/blob/8e21c57c622b05a1815bcf9927458ebb3973ef2e/lean/A303639/Counterexample.lean\"]\ntheorem conjecture.counterexample : ¬ A 800322180 := by\n  sorry\n\nend OeisA303639\n",
  "statement_hash": "215bbea78139ab601df492f7ed679de357bd310e68dc4d6dd9390c497bc5f843",
  "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."
}