{
  "id": "6572",
  "ident": "NS.06572",
  "slug": "oeis-49473",
  "title": "Nearest integer to $n/\\sqrt{2}$",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $s(n) = \\zeta(3) - \\sum_{k=1}^n \\frac{1}{k^3}$.\nConjecture: for $n \\ge 1$, $s(a(n)) < \\frac{1}{n^2} < s(a(n)-1)$, and the difference sequence of\nA049473 consists solely of $0$'s and $1$'s, in positions given by the nonhomogeneous Beatty\nsequences A001954 and A001953, respectively.\n- Clark Kimberling, Oct 05 2014",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA49473.conjecture",
  "statement_lean": "theorem conjecture :\n    (∀ n : ℕ, 1 ≤ n → s (a n) < 1 / (n : ℝ) ^ 2 ∧ 1 / (n : ℝ) ^ 2 < s (a n - 1)) ∧\n    (∀ n : ℕ, 1 ≤ n →\n      let diff : ℕ := a n - a (n - 1)\n      (diff = 0 ↔ n - 1 ∈ A001954) ∧ (diff = 1 ↔ n - 1 ∈ A001953))",
  "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# Nearest integer to $n/\\sqrt{2}$\n\nNearest integer to $n/\\sqrt{2}$, defined by $\\lfloor n/\\sqrt{2} + 1/2 \\rfloor$.\n\n*References:*\n- [A049473](https://oeis.org/A049473)-/\n\n@[expose] public section\n\nnamespace OeisA49473\n\n/-- Nearest integer to $n/\\sqrt{2}$. -/\nnoncomputable def a (n : ℕ) : ℕ :=\n  (Int.floor ((n : ℝ) / Real.sqrt 2 + 1 / 2)).toNat\n\n@[category test, AMS 11]\ntheorem a_0 : a 0 = 0 := by\n  dsimp [a]\n  have h : ((0 : ℕ) : ℝ) / Real.sqrt 2 + 1 / 2 = (1 / 2 : ℝ) := by\n    simp\n  rw [h]\n  have hf : Int.floor (1 / 2 : ℝ) = 0 := by\n    rw [Int.floor_eq_iff]\n    constructor <;> norm_num\n  rw [hf]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 1 := by\n  unfold a\n  have h1 : ((1 : ℕ) : ℝ) = 1 := by norm_num\n  rw [h1]\n  have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)\n  have hf : Int.floor ((1 : ℝ) / Real.sqrt 2 + 1 / 2) = 1 := by\n    rw [Int.floor_eq_iff]\n    constructor\n    · have hle : Real.sqrt 2 ≤ 2 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)\n      have : (1 / 2 : ℝ) ≤ 1 / Real.sqrt 2 := by\n        rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]\n        linarith\n      linarith\n    · have hlt : (2 / 3 : ℝ) < Real.sqrt 2 := by\n        rw [Real.lt_sqrt (by norm_num)]\n        norm_num\n      have : 1 / Real.sqrt 2 < (3 / 2 : ℝ) := by\n        rw [div_lt_iff₀ h_sqrt_pos]\n        linarith\n      linarith\n  rw [hf]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 1 := by\n  unfold a\n  have h2 : ((2 : ℕ) : ℝ) = 2 := by norm_num\n  rw [h2]\n  have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)\n  have hf : Int.floor ((2 : ℝ) / Real.sqrt 2 + 1 / 2) = 1 := by\n    rw [Int.floor_eq_iff]\n    constructor\n    · have hle : Real.sqrt 2 ≤ 4 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)\n      have : (1 / 2 : ℝ) ≤ 2 / Real.sqrt 2 := by\n        rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]\n        linarith\n      linarith\n    · have hlt : (4 / 3 : ℝ) < Real.sqrt 2 := by\n        rw [Real.lt_sqrt (by norm_num)]\n        norm_num\n      have : 2 / Real.sqrt 2 < (3 / 2 : ℝ) := by\n        rw [div_lt_iff₀ h_sqrt_pos]\n        linarith\n      linarith\n  rw [hf]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 2 := by\n  unfold a\n  have h3 : ((3 : ℕ) : ℝ) = 3 := by norm_num\n  rw [h3]\n  have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)\n  have hf : Int.floor ((3 : ℝ) / Real.sqrt 2 + 1 / 2) = 2 := by\n    rw [Int.floor_eq_iff]\n    constructor\n    · have hle : Real.sqrt 2 ≤ 2 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)\n      have : (3 / 2 : ℝ) ≤ 3 / Real.sqrt 2 := by\n        rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]\n        linarith\n      linarith\n    · have hlt : (6 / 5 : ℝ) < Real.sqrt 2 := by\n        rw [Real.lt_sqrt (by norm_num)]\n        norm_num\n      have : 3 / Real.sqrt 2 < (5 / 2 : ℝ) := by\n        rw [div_lt_iff₀ h_sqrt_pos]\n        linarith\n      linarith\n  rw [hf]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 3 := by\n  unfold a\n  have h4 : ((4 : ℕ) : ℝ) = 4 := by norm_num\n  rw [h4]\n  have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)\n  have hf : Int.floor ((4 : ℝ) / Real.sqrt 2 + 1 / 2) = 3 := by\n    rw [Int.floor_eq_iff]\n    constructor\n    · have hle : Real.sqrt 2 ≤ 8 / 5 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)\n      have : (5 / 2 : ℝ) ≤ 4 / Real.sqrt 2 := by\n        rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]\n        linarith\n      linarith\n    · have hlt : (8 / 7 : ℝ) < Real.sqrt 2 := by\n        rw [Real.lt_sqrt (by norm_num)]\n        norm_num\n      have : 4 / Real.sqrt 2 < (7 / 2 : ℝ) := by\n        rw [div_lt_iff₀ h_sqrt_pos]\n        linarith\n      linarith\n  rw [hf]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_5 : a 5 = 4 := by\n  unfold a\n  have h5 : ((5 : ℕ) : ℝ) = 5 := by norm_num\n  rw [h5]\n  have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)\n  have hf : Int.floor ((5 : ℝ) / Real.sqrt 2 + 1 / 2) = 4 := by\n    rw [Int.floor_eq_iff]\n    constructor\n    · have hle : Real.sqrt 2 ≤ 10 / 7 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)\n      have : (7 / 2 : ℝ) ≤ 5 / Real.sqrt 2 := by\n        rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]\n        linarith\n      linarith\n    · have hlt : (10 / 9 : ℝ) < Real.sqrt 2 := by\n        rw [Real.lt_sqrt (by norm_num)]\n        norm_num\n      have : 5 / Real.sqrt 2 < (9 / 2 : ℝ) := by\n        rw [div_lt_iff₀ h_sqrt_pos]\n        linarith\n      linarith\n  rw [hf]\n  rfl\n\n/-- $\\zeta(3)$ (Apéry's constant). -/\nnoncomputable def zetaThreeReal : ℝ :=\n  (riemannZeta 3).re\n\n/-- Let $s(n) = \\zeta(3) - \\sum_{k=1}^{n} 1/k^3$. -/\nnoncomputable def s (n : ℕ) : ℝ :=\n  zetaThreeReal - ∑ k ∈ Finset.range n, (1 : ℝ) / ((k + 1 : ℝ) ^ 3)\n\n/-- A001953: Nonhomogeneous Beatty sequence $\\lfloor (k + 1/2)\\sqrt{2} \\rfloor$ for $k \\ge 0$. -/\ndef A001953 : Set ℕ :=\n  {n | ∃ k : ℕ, n = (Int.floor (((k : ℝ) + 1 / 2) * Real.sqrt 2)).toNat}\n\n/-- A001954: Nonhomogeneous Beatty sequence $\\lfloor (k + 1/2)(2 + \\sqrt{2}) \\rfloor$ for $k \\ge 0$. -/\ndef A001954 : Set ℕ :=\n  {n | ∃ k : ℕ, n = (Int.floor (((k : ℝ) + 1 / 2) * (2 + Real.sqrt 2))).toNat}\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $s(n) = \\zeta(3) - \\sum_{k=1}^n \\frac{1}{k^3}$.\nConjecture: for $n \\ge 1$, $s(a(n)) < \\frac{1}{n^2} < s(a(n)-1)$, and the difference sequence of\nA049473 consists solely of $0$'s and $1$'s, in positions given by the nonhomogeneous Beatty\nsequences A001954 and A001953, respectively.\n- Clark Kimberling, Oct 05 2014\n-/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/oeis-a049473-zeta3-beatty/blob/b3a74bf/lean/OeisA49473FC.lean#L667-L673\"]\ntheorem conjecture :\n    (∀ n : ℕ, 1 ≤ n → s (a n) < 1 / (n : ℝ) ^ 2 ∧ 1 / (n : ℝ) ^ 2 < s (a n - 1)) ∧\n    (∀ n : ℕ, 1 ≤ n →\n      let diff : ℕ := a n - a (n - 1)\n      (diff = 0 ↔ n - 1 ∈ A001954) ∧ (diff = 1 ↔ n - 1 ∈ A001953)) := by\n  sorry\n\nend OeisA49473\n",
  "statement_hash": "1c56cd0be5a5b33777cada2d8f0aa57d6c067e2151f1d522c7f74a38f7207cf4",
  "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."
}