{
  "id": "7699",
  "ident": "NS.07699",
  "slug": "wikipedia-buchi",
  "title": "Büchi's problem",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "**Büchi's problem**\nThere exists a positive integer $M$ such that, for all integers $x$ and $a$,\nif $(x+n)^2 + a$ is a square for $M$ consecutive values of $n$, then $a = 0$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "wikipedia",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Buchi.buchi_problem",
  "statement_lean": "theorem buchi_problem :\n    ∃ M : ℕ, 1 ≤ M ∧ IsBuchi M",
  "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# Büchi's problem\n\n*References:*\n- [Wikipedia](https://en.wikipedia.org/wiki/B%C3%BCchi%27s_problem)\n-/\n\n@[expose] public section\n\nnamespace Buchi\n\n/-- `IsBuchi M` asserts that whenever `M` consecutive values `(x + n)² + a` (for\n`n = 0, …, M - 1`) are all perfect squares, then `a` must be `0`. -/\ndef IsBuchi (M : ℕ) : Prop :=\n  ∀ x a : ℤ, (∀ n ∈ Finset.range M, IsSquare ((x + (n : ℤ)) ^ 2 + a)) → a = 0\n\n/--\n**Büchi's problem**\nThere exists a positive integer $M$ such that, for all integers $x$ and $a$,\nif $(x+n)^2 + a$ is a square for $M$ consecutive values of $n$, then $a = 0$.\n-/\n@[category research open, question, AMS 11]\ntheorem buchi_problem :\n    ∃ M : ℕ, 1 ≤ M ∧ IsBuchi M := by\n  sorry\n\n\n/--\n**Büchi's problem (first open case, $M = 5$)**:\nFor all integers $x$ and $a$, if $(x+n)^2 + a$ is a perfect square for $n = 0, 1, 2, 3, 4$,\nthen $a = 0$.\n\nNon-trivial sequences of length 3 and 4 are known to exist, so $M = 5$ is the first open case.\n-/\n@[category research open, AMS 11]\ntheorem buchi_problem_M5 : IsBuchi 5 := by\n  sorry\n\n/-- The case $M = 0$ fails: the hypothesis is vacuous, so $a = 0$ cannot be concluded. -/\n@[category test, AMS 11]\ntheorem buchi_false_M0 : ¬ IsBuchi 0 := by\n  simp only [IsBuchi, Finset.range_zero, not_forall, exists_prop]\n  exact ⟨0, 1, by norm_num⟩\n\n/-- The case $M = 1$ fails: $0^2 + 4 = 4 = 2^2$ is a square but $a = 4 \\neq 0$. -/\n@[category test, AMS 11]\ntheorem buchi_false_M1 : ¬ IsBuchi 1 := by\n  simp only [IsBuchi, not_forall]\n  refine ⟨0, 4, ?_, by norm_num⟩\n  intro n hn\n  simp only [Finset.range_one, Finset.mem_singleton] at hn; subst hn\n  exact ⟨2, by norm_num⟩\n\n/-- The case $M = 2$ fails: $(7+n)^2 - 48$ is a perfect square for $n = 0, 1$\n($1^2$ and $4^2$), but $a = -48 \\neq 0$. -/\n@[category test, AMS 11]\ntheorem buchi_false_M2 : ¬ IsBuchi 2 := by\n  simp only [IsBuchi, not_forall]\n  refine ⟨7, -48, ?_, by norm_num⟩\n  intro n hn\n  simp [Finset.mem_range] at hn\n  interval_cases n\n  · exact ⟨1, by norm_num⟩\n  · exact ⟨4, by norm_num⟩\n\n/-- The case $M = 3$ fails: $(24+n)^2 - 576$ is a perfect square for $n = 0, 1, 2$\n($0^2$, $7^2$, and $10^2$), but $a = -576 \\neq 0$. -/\n@[category test, AMS 11]\ntheorem buchi_false_M3 : ¬ IsBuchi 3 := by\n  simp only [IsBuchi, not_forall]\n  refine ⟨24, -576, ?_, by norm_num⟩\n  intro n hn\n  simp [Finset.mem_range] at hn\n  interval_cases n\n  · exact ⟨0, by norm_num⟩\n  · exact ⟨7, by norm_num⟩\n  · exact ⟨10, by norm_num⟩\n\n/-- The case $M = 4$ fails: $(246+n)^2 - 60480$ is a perfect square for $n = 0, 1, 2, 3$\n($6^2$, $23^2$, $32^2$, and $39^2$), but $a = -60480 \\neq 0$.\nThe sequence $(6, 23, 32, 39)$ is a nontrivial Büchi sequence of length 4 (Hensley 1983). -/\n@[category test, AMS 11]\ntheorem buchi_false_M4 : ¬ IsBuchi 4 := by\n  simp only [IsBuchi, not_forall]\n  refine ⟨246, -60480, ?_, by norm_num⟩\n  intro n hn\n  simp [Finset.mem_range] at hn\n  interval_cases n\n  · exact ⟨6, by norm_num⟩\n  · exact ⟨23, by norm_num⟩\n  · exact ⟨32, by norm_num⟩\n  · exact ⟨39, by norm_num⟩\n\nend Buchi\n",
  "statement_hash": "71716cb13181d43db271bdcab062a3844cea3fda157438b452b897d5d865b2ce",
  "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."
}