Show full file and definitions
/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import FormalConjecturesUtil
/-!
# Partial sums of $(-1)^{k - \Omega(k)}$
The sequence $a(n) = \sum_{k=1}^n (-1)^{k - \Omega(k)}$, where $\Omega(k)$ is the total number of
prime factors of $k$ counted with multiplicity.
*References:*
- [A212496](https://oeis.org/A212496)
-/
@[expose] public section
namespace OeisA212496
open scoped ArithmeticFunction.Omega
/-- $a(n) = \sum_{k=1}^n (-1)^{k - \Omega(k)}$. -/
def a (n : ℕ) : ℤ :=
∑ k ∈ Finset.Icc 1 n, if (k + Ω k) % 2 = 0 then 1 else -1
@[category test, AMS 11]
theorem a_1 : a 1 = -1 := by
simp only [a, ArithmeticFunction.cardFactors_apply]; decide +kernel
@[category test, AMS 11]
theorem a_2 : a 2 = -2 := by
simp only [a, ArithmeticFunction.cardFactors_apply]; decide +kernel
@[category test, AMS 11]
theorem a_3 : a 3 = -1 := by
simp only [a, ArithmeticFunction.cardFactors_apply]; decide +kernel
@[category test, AMS 11]
theorem a_4 : a 4 = 0 := by
simp only [a, ArithmeticFunction.cardFactors_apply]; decide +kernel
@[category test, AMS 11]
theorem a_5 : a 5 = 1 := by
simp only [a, ArithmeticFunction.cardFactors_apply]; decide +kernel
/-- Auxiliary sequence $b(n) = \sum_{k=1}^n \frac{(-1)^{k - \Omega(k)}}{k}$. -/
def b (n : ℕ) : ℚ :=
∑ k ∈ Finset.Icc 1 n, (if (k + Ω k) % 2 = 0 then (1 : ℚ) else -1) / (k : ℚ)
/--
"On May 16 2012, Zhi-Wei Sun conjectured that $a(n)$ is positive for each $n > 4$."
- _Zhi-Wei Sun_, May 19 2012
-/
@[category research open, AMS 11]
theorem conjecture_1 (n : ℕ) (hn : 4 < n) : 0 < a n := by
sorry
/--
"Moreover, he guessed that $a(n) > \sqrt{n}$ for any $n > 324$."
- _Zhi-Wei Sun_, May 19 2012
-/
@[category research open, AMS 11]
theorem conjecture_2 (n : ℕ) (hn : 324 < n) :
Real.sqrt (n : ℝ) < (a n : ℝ) := by
sorry
/--
"He also guessed that $a(n) < \sqrt{n}\log(\log(n))$ for $n > 5892$."
- _Zhi-Wei Sun_, May 19 2012
-/
@[category research open, AMS 11]
theorem conjecture_3 (n : ℕ) (hn : 5892 < n) :
(a n : ℝ) < Real.sqrt (n : ℝ) * Real.log (Real.log (n : ℝ)) := by
sorry
/--
"Sun also conjectured that $b(n) = \sum_{k=1}^n (-1)^{k-\Omega(k)}/k < 0$ for all $n=1,2,3,\dots$"
- _Zhi-Wei Sun_, May 19 2012
-/
@[category research open, AMS 11]
theorem conjecture_4 (n : ℕ) (hn : 0 < n) : b n < 0 := by
sorry
/--
"Moreover, he guessed that $b(n) < -1/\sqrt{n}$ for all $n > 1$."
- _Zhi-Wei Sun_, May 19 2012
-/
@[category research open, AMS 11]
theorem conjecture_5 (n : ℕ) (hn : 1 < n) :
(b n : ℝ) < -1 / Real.sqrt (n : ℝ) := by
sorry
/--
"He also guessed that $b(n) > -\log(\log(n))/\sqrt{n}$ for $n > 2008$."
- _Zhi-Wei Sun_, May 19 2012
-/
@[category research open, AMS 11]
theorem conjecture_6 (n : ℕ) (hn : 2008 < n) :
-Real.log (Real.log (n : ℝ)) / Real.sqrt (n : ℝ) < (b n : ℝ) := by
sorry
end OeisA212496