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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:A nonlinear recurrence sequence

Source:OEIS conjectures
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Conjecture: a(n)=4a(n−1)−a(n−3)+a(n−4)a(n) = 4 a(n-1) - a(n-3) + a(n-4).

  • Colin Barker, Feb 16 2012
Subjects:Number Theory (math.NT)
MSC classes:11
Tags:formal_proof
Cite as:NS.05414 [math.NT] · NS.05414v1 for this version
Declaration:OeisA22030.conjecture
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:4b0f6b1e957e08f057b9306f7eb01879246ec20df504feca626e5a328ebca39e
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/22030.lean

Formal statement

theorem conjecture (n : ℕ) (hn : 4 ≤ n) :
    a n = 4 * a (n - 1) - a (n - 3) + a (n - 4)
Show the full Challenge.lean (81 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# A nonlinear recurrence sequence

For even $n$, $a(n+2)$ is the greatest integer such that $a(n+2)/a(n+1) < a(n+1)/a(n)$;
for odd $n$, the least integer such that $a(n+2)/a(n+1) > a(n+1)/a(n)$;
$a(0) = 4, a(1) = 16$.

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

@[expose] public section

namespace OeisA22030

/--
For even $n$, $a(n+2)$ is the greatest integer such that $a(n+2)/a(n+1) < a(n+1)/a(n)$;
for odd $n$, the least integer such that $a(n+2)/a(n+1) > a(n+1)/a(n)$;
$a(0) = 4, a(1) = 16$.
-/
def a (n : ℕ) : ℕ :=
  match n with
  | 0 => 4
  | 1 => 16
  | n + 2 =>
    if Even n then
      (a (n + 1) ^ 2 + a n - 1) / a n - 1
    else
      (a (n + 1) ^ 2) / a n + 1

@[category test, AMS 11]
theorem a_0 : a 0 = 4 := by rfl

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

@[category test, AMS 11]
theorem a_2 : a 2 = 63 := by rfl

@[category test, AMS 11]
theorem a_3 : a 3 = 249 := by rfl

@[category test, AMS 11]
theorem a_4 : a 4 = 984 := by rfl

@[category test, AMS 11]
theorem a_5 : a 5 = 3889 := by rfl

set_option linter.style.formal_proof_palomar false in
/--
Conjecture: $a(n) = 4 a(n-1) - a(n-3) + a(n-4)$.
- Colin Barker, Feb 16 2012
-/
@[category research solved, AMS 11,
  formal_proof using lean4 at
    "https://github.com/KitaKen1/oeis-a022030-lean/blob/f74afc2/lean/OeisA22030FC.lean#L270-L275"]
theorem conjecture (n : ℕ) (hn : 4 ≤ n) :
    a n = 4 * a (n - 1) - a (n - 3) + a (n - 4) := by
  sorry

end OeisA22030

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

nosorry fetch oeis-22030
nosorry submit oeis-22030 nosorry/oeis-22030/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.