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 · a_4

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.05412 [math.NT] · NS.05412v1 for this version
Declaration:OeisA22030.a_4
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
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 a_4 : a 4 = 984
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.a_4 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_a_4 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

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