Title:Nearest integer to
Statement:Let . Conjecture: for , , and the difference sequence of A049473 consists solely of 's and 's, in positions given by the nonhomogeneous Beatty sequences A001954 and A001953, respectively.
- Clark Kimberling, Oct 05 2014
| Subjects: | Number Theory (math.NT) |
| MSC classes: | 11 |
| Tags: | formal_proof |
| Cite as: | NS.06572 [math.NT] · NS.06572v1 for this version |
| Declaration: | OeisA49473.conjecture |
| Verification: | Lean kernel (formal proof) |
| Points: | first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60 |
| Statement hash: | 1c56cd0be5a5b33777cada2d8f0aa57d6c067e2151f1d522c7f74a38f7207cf4 |
| Toolchain: | leanprover/lean4:v4.33.1 |
| Licence: | Apache-2.0 · google-deepmind/formal-conjectures contributors |
| Upstream: | FormalConjectures/OEIS/49473.lean |
Formal statement
theorem conjecture :
(∀ n : ℕ, 1 ≤ n → s (a n) < 1 / (n : ℝ) ^ 2 ∧ 1 / (n : ℝ) ^ 2 < s (a n - 1)) ∧
(∀ n : ℕ, 1 ≤ n →
let diff : ℕ := a n - a (n - 1)
(diff = 0 ↔ n - 1 ∈ A001954) ∧ (diff = 1 ↔ n - 1 ∈ A001953))Show the full Challenge.lean (203 lines) — definitions included
module
public import FormalConjecturesUtil
/-!
# Nearest integer to $n/\sqrt{2}$
Nearest integer to $n/\sqrt{2}$, defined by $\lfloor n/\sqrt{2} + 1/2 \rfloor$.
*References:*
- [A049473](https://oeis.org/A049473)-/
@[expose] public section
namespace OeisA49473
/-- Nearest integer to $n/\sqrt{2}$. -/
noncomputable def a (n : ℕ) : ℕ :=
(Int.floor ((n : ℝ) / Real.sqrt 2 + 1 / 2)).toNat
@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by
dsimp [a]
have h : ((0 : ℕ) : ℝ) / Real.sqrt 2 + 1 / 2 = (1 / 2 : ℝ) := by
simp
rw [h]
have hf : Int.floor (1 / 2 : ℝ) = 0 := by
rw [Int.floor_eq_iff]
constructor <;> norm_num
rw [hf]
rfl
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by
unfold a
have h1 : ((1 : ℕ) : ℝ) = 1 := by norm_num
rw [h1]
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)
have hf : Int.floor ((1 : ℝ) / Real.sqrt 2 + 1 / 2) = 1 := by
rw [Int.floor_eq_iff]
constructor
· have hle : Real.sqrt 2 ≤ 2 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)
have : (1 / 2 : ℝ) ≤ 1 / Real.sqrt 2 := by
rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]
linarith
linarith
· have hlt : (2 / 3 : ℝ) < Real.sqrt 2 := by
rw [Real.lt_sqrt (by norm_num)]
norm_num
have : 1 / Real.sqrt 2 < (3 / 2 : ℝ) := by
rw [div_lt_iff₀ h_sqrt_pos]
linarith
linarith
rw [hf]
rfl
@[category test, AMS 11]
theorem a_2 : a 2 = 1 := by
unfold a
have h2 : ((2 : ℕ) : ℝ) = 2 := by norm_num
rw [h2]
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)
have hf : Int.floor ((2 : ℝ) / Real.sqrt 2 + 1 / 2) = 1 := by
rw [Int.floor_eq_iff]
constructor
· have hle : Real.sqrt 2 ≤ 4 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)
have : (1 / 2 : ℝ) ≤ 2 / Real.sqrt 2 := by
rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]
linarith
linarith
· have hlt : (4 / 3 : ℝ) < Real.sqrt 2 := by
rw [Real.lt_sqrt (by norm_num)]
norm_num
have : 2 / Real.sqrt 2 < (3 / 2 : ℝ) := by
rw [div_lt_iff₀ h_sqrt_pos]
linarith
linarith
rw [hf]
rfl
@[category test, AMS 11]
theorem a_3 : a 3 = 2 := by
unfold a
have h3 : ((3 : ℕ) : ℝ) = 3 := by norm_num
rw [h3]
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)
have hf : Int.floor ((3 : ℝ) / Real.sqrt 2 + 1 / 2) = 2 := by
rw [Int.floor_eq_iff]
constructor
· have hle : Real.sqrt 2 ≤ 2 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)
have : (3 / 2 : ℝ) ≤ 3 / Real.sqrt 2 := by
rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]
linarith
linarith
· have hlt : (6 / 5 : ℝ) < Real.sqrt 2 := by
rw [Real.lt_sqrt (by norm_num)]
norm_num
have : 3 / Real.sqrt 2 < (5 / 2 : ℝ) := by
rw [div_lt_iff₀ h_sqrt_pos]
linarith
linarith
rw [hf]
rfl
@[category test, AMS 11]
theorem a_4 : a 4 = 3 := by
unfold a
have h4 : ((4 : ℕ) : ℝ) = 4 := by norm_num
rw [h4]
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)
have hf : Int.floor ((4 : ℝ) / Real.sqrt 2 + 1 / 2) = 3 := by
rw [Int.floor_eq_iff]
constructor
· have hle : Real.sqrt 2 ≤ 8 / 5 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)
have : (5 / 2 : ℝ) ≤ 4 / Real.sqrt 2 := by
rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]
linarith
linarith
· have hlt : (8 / 7 : ℝ) < Real.sqrt 2 := by
rw [Real.lt_sqrt (by norm_num)]
norm_num
have : 4 / Real.sqrt 2 < (7 / 2 : ℝ) := by
rw [div_lt_iff₀ h_sqrt_pos]
linarith
linarith
rw [hf]
rfl
@[category test, AMS 11]
theorem a_5 : a 5 = 4 := by
unfold a
have h5 : ((5 : ℕ) : ℝ) = 5 := by norm_num
rw [h5]
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num)
have hf : Int.floor ((5 : ℝ) / Real.sqrt 2 + 1 / 2) = 4 := by
rw [Int.floor_eq_iff]
constructor
· have hle : Real.sqrt 2 ≤ 10 / 7 := (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)
have : (7 / 2 : ℝ) ≤ 5 / Real.sqrt 2 := by
rw [div_le_div_iff₀ (by norm_num) h_sqrt_pos]
linarith
linarith
· have hlt : (10 / 9 : ℝ) < Real.sqrt 2 := by
rw [Real.lt_sqrt (by norm_num)]
norm_num
have : 5 / Real.sqrt 2 < (9 / 2 : ℝ) := by
rw [div_lt_iff₀ h_sqrt_pos]
linarith
linarith
rw [hf]
rfl
/-- $\zeta(3)$ (Apéry's constant). -/
noncomputable def zetaThreeReal : ℝ :=
(riemannZeta 3).re
/-- Let $s(n) = \zeta(3) - \sum_{k=1}^{n} 1/k^3$. -/
noncomputable def s (n : ℕ) : ℝ :=
zetaThreeReal - ∑ k ∈ Finset.range n, (1 : ℝ) / ((k + 1 : ℝ) ^ 3)
/-- A001953: Nonhomogeneous Beatty sequence $\lfloor (k + 1/2)\sqrt{2} \rfloor$ for $k \ge 0$. -/
def A001953 : Set ℕ :=
{n | ∃ k : ℕ, n = (Int.floor (((k : ℝ) + 1 / 2) * Real.sqrt 2)).toNat}
/-- A001954: Nonhomogeneous Beatty sequence $\lfloor (k + 1/2)(2 + \sqrt{2}) \rfloor$ for $k \ge 0$. -/
def A001954 : Set ℕ :=
{n | ∃ k : ℕ, n = (Int.floor (((k : ℝ) + 1 / 2) * (2 + Real.sqrt 2))).toNat}
set_option linter.style.formal_proof_palomar false in
/--
Let $s(n) = \zeta(3) - \sum_{k=1}^n \frac{1}{k^3}$.
Conjecture: for $n \ge 1$, $s(a(n)) < \frac{1}{n^2} < s(a(n)-1)$, and the difference sequence of
A049473 consists solely of $0$'s and $1$'s, in positions given by the nonhomogeneous Beatty
sequences A001954 and A001953, respectively.
- Clark Kimberling, Oct 05 2014
-/
@[category research solved, AMS 11,
formal_proof using lean4 at
"https://github.com/KitaKen1/oeis-a049473-zeta3-beatty/blob/b3a74bf/lean/OeisA49473FC.lean#L667-L673"]
theorem conjecture :
(∀ n : ℕ, 1 ≤ n → s (a n) < 1 / (n : ℝ) ^ 2 ∧ 1 / (n : ℝ) ^ 2 < s (a n - 1)) ∧
(∀ n : ℕ, 1 ≤ n →
let diff : ℕ := a n - a (n - 1)
(diff = 0 ↔ n - 1 ∈ A001954) ∧ (diff = 1 ↔ n - 1 ∈ A001953)) := by
sorry
end OeisA49473
To prove it: keep every definition of Challenge.lean unchanged and prove OeisA49473.conjecture with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_conjecture : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.
nosorry fetch oeis-49473 nosorry submit oeis-49473 nosorry/oeis-49473/Solution.lean --wait
Contributions
No contributions yet — be the first. Submit a proof or a finding.
Research in progress
People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.
Nobody has shared research on this problem yet.
Sign in to share your research.
Statement review
Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.
Sign in to open a critique.