{
  "id": "2130",
  "ident": "NS.02130",
  "slug": "erdos-436",
  "title": "Erdős Problem 436",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "If $p$ is a prime and $k, m \\geq 2$, let $r(k, m, p)$ be the minimal $r$ such that\n$r, r + 1, \\ldots, r + m - 1$ are all $k$th power residues modulo $p$, and let\n$\\Lambda(k, m) = \\limsup_{p \\to \\infty} r(k, m, p)$. Is $\\Lambda(k, 2)$ finite for all $k$?\n\nA question of Lehmer and Lehmer [LeLe62]. Hildebrand [Hi91] proved that $\\Lambda(k, 2)$ is finite\nfor all $k \\geq 2$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos436.erdos_436.parts.i",
  "statement_lean": "theorem erdos_436.parts.i : ∀ k ≥ 2, Λ k 2 < ⊤",
  "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-/\n\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 436\n\n*References:*\n- [erdosproblems.com/436](https://www.erdosproblems.com/436)\n- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number\n  theory*. Monographies de L'Enseignement Mathematique (1980).\n- [LeLe62] Lehmer, D. H. and Lehmer, Emma, *On runs of residues*. Proc. Amer. Math. Soc. (1962),\n  102-106.\n- [LLMS62] Lehmer, D. H. and Lehmer, E. and Mills, W. H. and Selfridge, J. L., *Machine proof of a\n  theorem on cubic residues*. Math. Comp. (1962), 407-415.\n- [BiMi63] Bierstedt, R. G. and Mills, W. H., *On the bound for a pair of consecutive quartic\n  residues of a prime*. Proc. Amer. Math. Soc. (1963), 628-632.\n- [LLM63] Lehmer, D. H. and Lehmer, Emma and Mills, W. H., *Pairs of consecutive power residues*.\n  Canadian J. Math. (1963), 172-177.\n- [BLL64] Brillhart, John and Lehmer, D. H. and Lehmer, Emma, *Bounds for pairs of consecutive\n  seventh and higher power residues*. Math. Comp. (1964), 397-407.\n- [Gr64g] Graham, R. L., *On quadruples of consecutive $k$th power residues*. Proc. Amer. Math.\n  Soc. (1964), 196-197.\n- [Du65] Dunton, M., *Bounds for pairs of cubic residues*. Proc. Amer. Math. Soc. (1965),\n  330-332.\n- [Hi91] Hildebrand, Adolf, *On consecutive $k$th power residues. II*. Michigan Math. J. (1991),\n  241-253.\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos436\n\n/-- `IsPowerResidue k p a` means that $a$ is a $k$th power residue modulo $p$, that is,\n$p \\nmid a$ and $a \\equiv x^k \\pmod{p}$ for some $x$. -/\ndef IsPowerResidue (k p a : ℕ) : Prop :=\n  (a : ZMod p) ≠ 0 ∧ ∃ x : ZMod p, x ^ k = a\n\n/-- `r k m p` is the least $r \\geq 1$ such that $r, r + 1, \\ldots, r + m - 1$ are all $k$th\npower residues modulo $p$, or `⊤` if there is no such $r$. -/\nnoncomputable def r (k m p : ℕ) : ℕ∞ :=\n  ⨅ (n : ℕ) (_ : 1 ≤ n ∧ ∀ i < m, IsPowerResidue k p (n + i)), (n : ℕ∞)\n\n/-- $\\Lambda(k, m) = \\limsup_{p \\to \\infty} r(k, m, p)$, where $p$ runs over the primes. -/\nnoncomputable def runLimsup (k m : ℕ) : ℕ∞ :=\n  limsup (r k m) (atTop ⊓ 𝓟 {p | p.Prime})\n\n@[inherit_doc] local notation \"Λ\" => runLimsup\n\n/--\nIf $p$ is a prime and $k, m \\geq 2$, let $r(k, m, p)$ be the minimal $r$ such that\n$r, r + 1, \\ldots, r + m - 1$ are all $k$th power residues modulo $p$, and let\n$\\Lambda(k, m) = \\limsup_{p \\to \\infty} r(k, m, p)$. Is $\\Lambda(k, 2)$ finite for all $k$?\n\nA question of Lehmer and Lehmer [LeLe62]. Hildebrand [Hi91] proved that $\\Lambda(k, 2)$ is finite\nfor all $k \\geq 2$.\n-/\n@[category research solved, question, AMS 11]\ntheorem erdos_436.parts.i : ∀ k ≥ 2, Λ k 2 < ⊤ := by\n  sorry\n\n/--\nIs $\\Lambda(k, 3)$ finite for all odd $k$?\n\nLehmer, Lehmer, Mills and Selfridge [LLMS62] proved $\\Lambda(3, 3) = 23532$. The question is open\nfor odd $k \\geq 5$.\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_436.parts.ii : ∀ k ≥ 3, Odd k → Λ k 3 < ⊤ := by\n  sorry\n\n/-- Lehmer and Lehmer [LeLe62] proved $\\Lambda(2, 2) = 9$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.two_two : Λ 2 2 = 9 := by\n  sorry\n\n/-- Dunton [Du65] proved $\\Lambda(3, 2) = 77$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.three_two : Λ 3 2 = 77 := by\n  sorry\n\n/-- Bierstedt and Mills [BiMi63] proved $\\Lambda(4, 2) = 1224$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.four_two : Λ 4 2 = 1224 := by\n  sorry\n\n/-- Lehmer, Lehmer and Mills [LLM63] proved $\\Lambda(5, 2) = 7888$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.five_two : Λ 5 2 = 7888 := by\n  sorry\n\n/-- Lehmer, Lehmer and Mills [LLM63] proved $\\Lambda(6, 2) = 202124$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.six_two : Λ 6 2 = 202124 := by\n  sorry\n\n/-- Brillhart, Lehmer and Lehmer [BLL64] proved $\\Lambda(7, 2) = 1649375$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.seven_two : Λ 7 2 = 1649375 := by\n  sorry\n\n/-- Lehmer, Lehmer, Mills and Selfridge [LLMS62] proved $\\Lambda(3, 3) = 23532$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.three_three : Λ 3 3 = 23532 := by\n  sorry\n\n/-- Lehmer and Lehmer [LeLe62] proved $\\Lambda(k, 3) = \\infty$ for all even $k$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.even_three : ∀ k ≥ 2, Even k → Λ k 3 = ⊤ := by\n  sorry\n\n/-- Graham [Gr64g] proved $\\Lambda(k, l) = \\infty$ for all $k \\geq 2$ and $l \\geq 4$. -/\n@[category research solved, AMS 11]\ntheorem erdos_436.variants.ge_four : ∀ k ≥ 2, ∀ l ≥ 4, Λ k l = ⊤ := by\n  sorry\n\n/-- Modulo $13$, the quadratic residues are $1, 3, 4, 9, 10, 12$, so the first pair of\nconsecutive quadratic residues starts at $3$. -/\n@[category test, AMS 11]\ntheorem r_two_two_thirteen : r 2 2 13 = 3 := by\n  have h2 : ¬ IsPowerResidue 2 13 2 := by\n    unfold IsPowerResidue\n    decide\n  apply le_antisymm\n  · refine iInf₂_le 3 ⟨by norm_num, ?_⟩\n    intro i hi\n    interval_cases i\n    · exact ⟨by decide, 4, by decide⟩\n    · exact ⟨by decide, 2, by decide⟩\n  · refine le_iInf₂ ?_\n    rintro n ⟨hn, h⟩\n    have : 3 ≤ n := by\n      by_contra hlt\n      interval_cases n\n      · exact h2 (h 1 (by norm_num))\n      · exact h2 (h 0 (by norm_num))\n    exact_mod_cast this\n\nend Erdos436\n",
  "statement_hash": "7cc33a8a2da0e7304dcad8dc29e104fcf9c0682c2d81ddb0ed9c2acd8101f9b7",
  "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."
}