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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Conjectures associated with A109671 · a_2

Source:OEIS conjectures
Sanity test Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Statement:

No informal statement.

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

Formal statement

theorem a_2 : a 2 = 1
Show the full Challenge.lean (79 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Conjectures associated with A109671

$a(1)=1$; thereafter, $a(2n)=a(n)$, $a(2n+1)$ is the smallest positive number
such that $|a(2n+1)-a(2n-1)|=a(n)$.
Conjecture: Does the sequence contain every positive integer?

*References:*
- [A109671](https://oeis.org/A109671)
-/

@[expose] public section

namespace OeisA109671

/--
The primary defining sequence `a`.
$a(1)=1$; thereafter, $a(2n)=a(n)$, $a(2n+1)$ is the smallest positive number
such that $|a(2n+1)-a(2n-1)|=a(n)$.
-/
def a (n : ℕ) : ℕ :=
  if n = 0 then 0
  else if n = 1 then 1
  else if n % 2 = 0 then
    a (n / 2)
  else
    let k := (n - 1) / 2
    let aPrevOdd := a (n - 2)
    let aMid := a k
    if aPrevOdd > aMid then
      aPrevOdd - aMid
    else
      aPrevOdd + aMid
termination_by n

@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by native_decide

@[category test, AMS 11]
theorem a_2 : a 2 = 1 := by native_decide

@[category test, AMS 11]
theorem a_3 : a 3 = 2 := by native_decide

@[category test, AMS 11]
theorem a_4 : a 4 = 1 := by native_decide

@[category test, AMS 11]
theorem a_5 : a 5 = 1 := by native_decide

/--
Does the sequence contain every positive integer (cf. A169741)?
-/
@[category research open, question, AMS 11]
theorem conjecture :
    ∀ m : ℕ, 0 < m → ∃ n : ℕ, 0 < n ∧ a n = m := by
  sorry

end OeisA109671

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

nosorry desk oeis-109671--a-2      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch oeis-109671--a-2
nosorry submit oeis-109671--a-2 nosorry/oeis-109671--a-2/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.