Index of theproofnetwork/open-problems@860a535/FormalConjectures/OEIS/A238281.lean

qedmarket’s copy of theproofnetwork/open-problems@860a535, 1 Dec 2026original source ↗

103 lines · 3.7 kBraw
/-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, softwaredistributed 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 andlimitations under the License.-/module public import FormalConjecturesUtil /-!# Equal prime counts in adjacent intervals $(kn, (k+1)n)$ and $((k+1)n, (k+2)n)$ Let $\pi$ denote the prime counting function. The sequence $a(n)$ counts the number of integers$0 < k < n$ such that the intervals $(kn, (k+1)n)$ and $((k+1)n, (k+2)n)$ contain the same numberof primes. *References:*- [A238281](https://oeis.org/A238281)-/ @[expose] public section namespace OeisA238281 /-- $a(n)$ is the number of integers $0 < k < n$ such that the two intervals $(kn, (k+1)n)$ and$((k+1)n, (k+2)n)$ contain the same number of primes. -/def a (n : ℕ) : ℕ :=  ∑ k ∈ Finset.Ico 1 n,    if Nat.primeCounting ((k + 1) * n) - Nat.primeCounting (k * n) =       Nat.primeCounting ((k + 2) * n) - Nat.primeCounting ((k + 1) * n) then 1 else 0 @[category test, AMS 11]theorem a_1 : a 1 = 0 := by decide @[category test, AMS 11]theorem a_2 : a 2 = 1 := by decide @[category test, AMS 11]theorem a_3 : a 3 = 2 := by decide @[category test, AMS 11]theorem a_4 : a 4 = 1 := by decide @[category test, AMS 11]theorem a_5 : a 5 = 2 := by decide /--Conjecture (i): $a(n) > 0$ for all $n > 1$.-/@[category research open, AMS 11]theorem conjecture_1 (n : ℕ) (hn : 1 < n) : 0 < a n := by  sorry /--Conjecture: Moreover, if $n > 1$ is not equal to $8$, then there is a positive integer $k < n$ with$2k + 1$ prime such that the two intervals $((k-1)n, kn]$ and $(kn, (k+1)n]$ contain the samenumber of primes. OEIS states open intervals, but for $n = 2$ the only candidate is $k = 1$, where the openinterval $(0, 2)$ contains 0 primes while $(2, 4)$ contains 1 prime. Half-open intervals$((k-1)n, kn]$ match Sun's Mathematica formula `PrimePi[k*n] - PrimePi[(k-1)*n]` and hold for$n = 2$. This is false. For $n = 14$ no such $k$ exists. For $n = 286$ no such $k$ exists either.-/@[category research solved, AMS 11]theorem conjecture_2 :    ¬ ∀ n : ℕ, 1 < n → n ≠ 8 →      ∃ k : ℕ, 0 < k ∧ k < n ∧ (2 * k + 1).Prime ∧        Nat.primeCounting (k * n) - Nat.primeCounting ((k - 1) * n) =        Nat.primeCounting ((k + 1) * n) - Nat.primeCounting (k * n) := by  intro h  obtain ⟨k, hk0, hk, hp, he⟩ := h 14 (by norm_num) (by norm_num)  interval_cases k <;> first    | (exfalso; revert hp; norm_num; done)    | (exfalso; revert he; decide +kernel) /--Conjecture (ii): For any integer $n > 4$, there is a positive integer $k < p_n$ such that all thethree intervals $(kn, (k+1)n)$, $((k+1)n, (k+2)n)$, $((k+2)n, (k+3)n)$ contain the same number ofprimes, i.e., $\pi(kn)$, $\pi((k+1)n)$, $\pi((k+2)n)$, $\pi((k+3)n)$ form a $4$-term arithmeticprogression.-/@[category research open, AMS 11]theorem conjecture_3 (n : ℕ) (hn : 4 < n) :    ∃ k : ℕ, 0 < k ∧ k < Nat.nth Nat.Prime (n - 1) ∧      Nat.primeCounting ((k + 1) * n) - Nat.primeCounting (k * n) =      Nat.primeCounting ((k + 2) * n) - Nat.primeCounting ((k + 1) * n) ∧      Nat.primeCounting ((k + 2) * n) - Nat.primeCounting ((k + 1) * n) =      Nat.primeCounting ((k + 3) * n) - Nat.primeCounting ((k + 2) * n) := by  sorry end OeisA238281

download (.tar)