Title:Rowland-style prime-generating recurrence · a_5
Statement:Value of the sequence
aat 5.
| Subjects: | Number Theory (math.NT) |
| MSC classes: | 11 |
| Cite as: | NS.05004 [math.NT] · NS.05004v1 for this version |
| Declaration: | OeisA166944.a_5 |
| Verification: | Lean kernel (formal proof) |
| Points: | first verified proof or disproof: 1; accepted critique: up to 100 |
| Statement hash: | 45bcd7950ca806b86c258221b98a44e62cfabebfac23d494120d48eaee910b5e |
| Toolchain: | leanprover/lean4:v4.33.1 |
| Licence: | Apache-2.0 · google-deepmind/formal-conjectures contributors |
| Upstream: | FormalConjectures/OEIS/166944.lean |
Formal statement
theorem a_5 : a 5 = 9Show the full Challenge.lean (90 lines) — definitions included
module
public import FormalConjecturesUtil
/-!
# Rowland-style prime-generating recurrence
The sequence is defined by $a(1) = 2$ and for $n \ge 2$:
$a(n) = a(n-1) + \gcd(n, a(n-1))$ if $n$ is even, and
$a(n) = a(n-1) + \gcd(n-2, a(n-1))$ if $n$ is odd.
*References:*
- [A166944](https://oeis.org/A166944)
- E. S. Rowland, "A natural prime-generating recurrence", *J. Integer Sequences* **11** (2008),
Article 08.2.8.
- V. Shevelev, "An infinite set of generators of primes based on the Rowland idea and
conjectures concerning twin primes", arXiv preprint
[arXiv:0910.4676](https://arxiv.org/abs/0910.4676) [math.NT], 2009.-/
@[expose] public section
namespace OeisA166944
/-- Defining recurrence for $a(n)$. -/
def a : ℕ → ℕ
| 0 => 0
| 1 => 2
| n + 2 =>
let prev := a (n + 1)
let idx := n + 2
if idx % 2 = 0 then prev + Nat.gcd idx prev
else prev + Nat.gcd (idx - 2) prev
/-- Value of the sequence `a` at 1. -/
@[category test, AMS 11]
theorem a_1 : a 1 = 2 := by decide
/-- Value of the sequence `a` at 2. -/
@[category test, AMS 11]
theorem a_2 : a 2 = 4 := by decide
/-- Value of the sequence `a` at 3. -/
@[category test, AMS 11]
theorem a_3 : a 3 = 5 := by decide
/-- Value of the sequence `a` at 4. -/
@[category test, AMS 11]
theorem a_4 : a 4 = 6 := by decide
/-- Value of the sequence `a` at 5. -/
@[category test, AMS 11]
theorem a_5 : a 5 = 9 := by decide
/-- The difference sequence $d(n) = a(n) - a(n-1)$ for $n \ge 2$. -/
def d (n : ℕ) : ℕ := a n - a (n - 1)
/-- A prime $p$ is the greater of a twin prime pair if $p$ and $p - 2$ are both prime. -/
def IsGreaterTwinPrime (p : ℕ) : Prop := p.Prime ∧ (p - 2).Prime
/--
A value $R$ is a difference record if there exists $n \ge 2$ such that $d(n) = R$ and $R$
is strictly larger than all previous differences $d(k)$ for $2 \le k < n$.-/
def IsDifferenceRecord (R : ℕ) : Prop :=
∃ n : ℕ, 2 ≤ n ∧ d n = R ∧ ∀ k : ℕ, 2 ≤ k → k < n → d k < R
/--
Conjecture: Every record of differences $a(n)-a(n-1)$ more than 5 is the greater of twin primes
(A006512).-/
@[category research open, AMS 11]
theorem conjecture (R : ℕ) (hR : 5 < R) (hrec : IsDifferenceRecord R) :
IsGreaterTwinPrime R := by
sorry
end OeisA166944
To prove it: keep every definition of Challenge.lean unchanged and prove OeisA166944.a_5 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_a_5 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.
nosorry desk oeis-166944--a-5 # a desk lease: required before submitting (renew: nosorry beat) nosorry fetch oeis-166944--a-5 nosorry submit oeis-166944--a-5 nosorry/oeis-166944--a-5/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.