Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Rowland's GCD prime-generating recurrence · rowlandSeq_initial_values

Source:Wikipedia lists of open problems
Sanity test Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Statement:

Checks the initial values a(1),…,a(6)=7,8,9,10,15,18a(1), \dots, a(6) = 7, 8, 9, 10, 15, 18 of rowlandSeq.

Subjects:Number Theory (math.NT)
MSC classes:11
Cite as:NS.08404 [math.NT] · NS.08404v1 for this version
Declaration:RowlandSequence.rowlandSeq_initial_values
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
Statement hash:e02ffc70e9ba60085f34b8efad795380fb8c57eec028e074c049b2a454770ca7
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/Wikipedia/RowlandSequence.lean

Formal statement

theorem rowlandSeq_initial_values :
    rowlandSeq 1 = 7 ∧ rowlandSeq 2 = 8 ∧ rowlandSeq 3 = 9 ∧
      rowlandSeq 4 = 10 ∧ rowlandSeq 5 = 15 ∧ rowlandSeq 6 = 18
Show the full Challenge.lean (88 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Rowland's GCD prime-generating recurrence

Define $a(1) = 7$ and $a(n) = a(n - 1) + \gcd(n, a(n - 1))$ for $n \ge 2$ (`OEIS A106108`), with
step increments $d(n) = a(n) - a(n - 1) = \gcd(n, a(n - 1))$ (`OEIS A132199` lists $d(n + 1)$ for
$n \ge 1$). Eric S. Rowland established in 2008 that every $d(n)$ with $n \ge 2$ equals $1$ or an
odd prime, and conjectured that every odd prime arises as $d(n)$ for some $n \ge 2$.

*References:*
- [Wikipedia](https://en.wikipedia.org/wiki/Formula_for_primes#Rowland%27s_prime-generating_sequence)
- [OEIS A106108](https://oeis.org/A106108)
- [OEIS A132199](https://oeis.org/A132199)
- E. S. Rowland, *A natural prime-generating recurrence*, J. Integer Seq. **11** (2008),
  Article 08.2.8.
-/

@[expose] public section

namespace RowlandSequence

/-- Rowland's sequence (`OEIS A106108`), starting at $a(1) = 7$ with recurrence
$a(n) = a(n - 1) + \gcd(n, a(n - 1))$ for $n \ge 2$ (and $a(0) = 0$). -/
def rowlandSeq : ℕ → ℕ
  | 0 => 0
  | 1 => 7
  | n + 2 =>
    let prev := rowlandSeq (n + 1)
    prev + Nat.gcd (n + 2) prev

/-- Step increment $d(n) = a(n) - a(n - 1)$ of `rowlandSeq` (meaningful for $n \ge 2$; shifted by
one from `OEIS A132199`, where `A132199(n) = rowlandDiff (n + 1)`). -/
def rowlandDiff (n : ℕ) : ℕ :=
  rowlandSeq n - rowlandSeq (n - 1)

/-- Checks the initial values $a(1), \dots, a(6) = 7, 8, 9, 10, 15, 18$ of `rowlandSeq`. -/
@[category test, AMS 11]
theorem rowlandSeq_initial_values :
    rowlandSeq 1 = 7 ∧ rowlandSeq 2 = 8 ∧ rowlandSeq 3 = 9 ∧
      rowlandSeq 4 = 10 ∧ rowlandSeq 5 = 15 ∧ rowlandSeq 6 = 18 := by
  decide

/-- Checks $d(2) = 1$ alongside the odd-prime increments $d(5) = 5$, $d(6) = 3$, and
$d(11) = 11$. -/
@[category test, AMS 11]
theorem rowlandDiff_small_witnesses :
    rowlandDiff 2 = 1 ∧ rowlandDiff 5 = 5 ∧ rowlandDiff 6 = 3 ∧ rowlandDiff 11 = 11 := by
  decide

/--
Rowland's theorem (2008): for every $n \ge 2$, the step $d(n) = a(n) - a(n - 1)$ equals $1$ or is
prime.
-/
@[category research solved, AMS 11]
theorem rowland_diff_eq_one_or_prime {n : ℕ} (hn : 2 ≤ n) :
    rowlandDiff n = 1 ∨ (rowlandDiff n).Prime := by
  sorry

/--
Rowland's conjecture (2008): every odd prime $p$ occurs as $d(n) = a(n) - a(n - 1)$ at some index
$n \ge 2$. The prime $2$ is excluded because $n$ and $a(n - 1)$ always have opposite parity, and
$n \ge 2$ excludes the artifact `rowlandDiff 1 = 7`.
-/
@[category research open, AMS 11]
theorem rowland_generates_all_odd_primes {p : ℕ} (hp : p.Prime) (hodd : Odd p) :
    ∃ n : ℕ, 2 ≤ n ∧ rowlandDiff n = p := by
  sorry

end RowlandSequence

To prove it: keep every definition of Challenge.lean unchanged and prove RowlandSequence.rowlandSeq_initial_values with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_rowlandSeq_initial_values : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry desk wikipedia-rowlandsequence--rowlandseq-initial-values      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch wikipedia-rowlandsequence--rowlandseq-initial-values
nosorry submit wikipedia-rowlandsequence--rowlandseq-initial-values nosorry/wikipedia-rowlandsequence--rowlandseq-initial-values/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.