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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Representation of sequence terms by harmonic numbers ⌊12H(n)−H(n2+n−1)−γ⌋\lfloor \frac{1}{2H(n) - H(n^2+n-1) - \gamma} \rfloor

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 (from A227581): a(n)=⌊1/(2H(n)−H(n2+n−1)−γ)⌋a(n) = \lfloor 1/(2 H(n) - H(n^2 + n - 1) - \gamma) \rfloor, where HH denotes harmonic numbers and γ\gamma denotes the Euler-Mascheroni constant.

A formal proof has been found with the methods described in arxiv/2605.22763.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:formal_proof
Cite as:NS.05448 [math.NT] · NS.05448v1 for this version
Declaration:OeisA227582.a_eq_floor_harmonic_expr
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:6655b0509b4c993cfee4cefd27850d156f170b600ec6037df84f8bce75b9d512
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/227582.lean

Formal statement

theorem a_eq_floor_harmonic_expr (n : ℕ) (hn : 0 < n) :
    a n = (Int.floor (1 / (2 * (↑(harmonic n) : ℝ) -
    (↑(harmonic (n * n + n - 1)) : ℝ) - Real.eulerMascheroniConstant))).toNat
Show the full Challenge.lean (129 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Representation of sequence terms by harmonic numbers $\lfloor \frac{1}{2H(n) - H(n^2+n-1) - \gamma} \rfloor$

A227582: Expansion of $(2+3x+2x^2+2x^3+3x^4+x^5-x^6)/(1-2x+x^2-x^5+2x^6-x^7)$.

The sequence satisfies the linear recurrence:
$$a(n) = 2 a(n-1) - a(n-2) + a(n-5) - 2 a(n-6) + a(n-7)$$
with initial values $a(1) = 2, a(2) = 7, a(3) = 14, a(4) = 23, a(5) = 35, a(6) = 50, a(7) = 67$.

The sequence is 1-indexed in OEIS, so $a(n)$ is the $(n-1)$-th term of the 0-indexed solution.

*References:*
- [A227582](https://oeis.org/A227582)
- [arxiv/2605.22763](https://arxiv.org/abs/2605.22763) *Advancing Mathematics Research with AI-Driven Formal Proof Search* by George Tsoukalas et al.
-/

@[expose] public section

namespace OeisA227582


open BigOperators LinearRecurrence

/--
The sequence $b_n$ such that $A227582(n) = b_{n-1}$ for $n \ge 1$.
This is the 0-indexed solution to the linear recurrence in $\mathbb{Z}$.
-/
def baseSeq (n : ℕ) : ℤ :=
  let order := 7
  -- Coefficients $c_i$ for the recurrence $u_{n+7} = \sum_{i=0}^6 c_i u_{n+i}$.
  -- This corresponds to the OEIS signature $(2, -1, 0, 0, 1, -2, 1)$ which means $c_i = s_{7-i}$.
  let coeffs : Fin order → ℤ := ![1, -2, 1, 0, 0, -1, 2]
  -- Initial values $a_zero$ through $a_6$. These are {2, 7, 14, 23, 35, 50, 67}.
  let init : Fin order → ℤ := ![2, 7, 14, 23, 35, 50, 67]
  let E : LinearRecurrence ℤ := { order := order, coeffs := coeffs }
  E.mkSol init n

/--
Expansion of $(2+3x+2x^2+2x^3+3x^4+x^5-x^6)/(1-2x+x^2-x^5+2x^6-x^7)$, 1-indexed.
-/
def a (n : ℕ) : ℕ :=
  if 0 < n then
    (baseSeq (n - 1)).toNat
  else
    0


@[category test, AMS 11]
lemma a_1 : a 1 = 2 := by dsimp [a]; native_decide

@[category test, AMS 11]
lemma a_2 : a 2 = 7 := by dsimp [a]; native_decide

@[category test, AMS 11]
lemma a_3 : a 3 = 14 := by dsimp [a]; native_decide

@[category test, AMS 11]
lemma a_4 : a 4 = 23 := by dsimp [a]; native_decide

@[category test, AMS 11]
lemma a_5 : a 5 = 35 := by dsimp [a]; native_decide

/--
The linear recurrence:
$$b(n + 7) = 2 b(n + 6) - b(n + 5) + b(n + 2) - 2 b(n + 1) + b(n)$$
holds for `baseSeq`. This follows directly from `LinearRecurrence.is_sol_mkSol`.
-/
@[category API, AMS 11]
theorem baseSeq_recurrence (n : ℕ) :
    baseSeq (n + 7) = 2 * baseSeq (n + 6) - baseSeq (n + 5) +
    baseSeq (n + 2) - 2 * baseSeq (n + 1) + baseSeq n := by
  let E : LinearRecurrence ℤ := ⟨7, ![1, -2, 1, 0, 0, -1, 2]⟩
  let init : Fin 7 → ℤ := ![2, 7, 14, 23, 35, 50, 67]
  -- baseSeq is definitionally E.mkSol init
  change E.mkSol init (n + 7) =
    2 * E.mkSol init (n + 6) - E.mkSol init (n + 5) +
    E.mkSol init (n + 2) - 2 * E.mkSol init (n + 1) + E.mkSol init n
  have h := E.is_sol_mkSol init n
  -- h : mkSol(n+7) = ∑ i : Fin 7, coeffs[i] * mkSol(n+i)
  rw [h]
  -- Expand the sum and reduce all coefficient lookups
  simp only [Fin.sum_univ_seven, E, Fin.isValue]
  -- Reduce matrix lookups: ![1, -2, 1, 0, 0, -1, 2] i for all i : Fin 7
  -- and Fin coercions: ↑(i : Fin 7) for each i
  norm_num [show (![1, -2, 1, 0, 0, -1, 2] : Fin 7 → ℤ) 0 = 1 from rfl,
    show (![1, -2, 1, 0, 0, -1, 2] : Fin 7 → ℤ) 1 = -2 from rfl,
    show (![1, -2, 1, 0, 0, -1, 2] : Fin 7 → ℤ) 2 = 1 from rfl,
    show (![1, -2, 1, 0, 0, -1, 2] : Fin 7 → ℤ) 3 = 0 from rfl,
    show (![1, -2, 1, 0, 0, -1, 2] : Fin 7 → ℤ) 4 = 0 from rfl,
    show (![1, -2, 1, 0, 0, -1, 2] : Fin 7 → ℤ) 5 = -1 from rfl,
    show (![1, -2, 1, 0, 0, -1, 2] : Fin 7 → ℤ) 6 = 2 from rfl]
  ring

set_option linter.style.formal_proof_palomar false in
/--
Conjecture (from A227581): $a(n) = \lfloor 1/(2 H(n) - H(n^2 + n - 1) - \gamma) \rfloor$,
where $H$ denotes harmonic numbers and $\gamma$ denotes the Euler-Mascheroni constant.

A formal proof has been found with the methods described in
[arxiv/2605.22763](https://arxiv.org/abs/2605.22763).
-/
@[category research solved, AMS 11, formal_proof using formal_conjectures at
"https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/227582.wip.lean#L282"]
theorem a_eq_floor_harmonic_expr (n : ℕ) (hn : 0 < n) :
    a n = (Int.floor (1 / (2 * (↑(harmonic n) : ℝ) -
    (↑(harmonic (n * n + n - 1)) : ℝ) - Real.eulerMascheroniConstant))).toNat := by
    sorry

end OeisA227582

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

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