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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Floor of sum of {n/k}\{n/k\}

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

A102722 Conjecture: a(n)∼(1−γ)na(n) \sim (1-\gamma)n.

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

Formal statement

theorem conjecture :
    (fun n : ℕ => (a n : ℝ)) ~[atTop]
      (fun n : ℕ => (1 - Real.eulerMascheroniConstant) * (n : ℝ))
Show the full Challenge.lean (110 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Floor of sum of $\{n/k\}$

Given $n$, sum all division remainders $\{n/k\}$, with $k=1,\dots,n$.
The value $a(n)$ is given by the floor of that sum. Note that $\{x\}:=x-[x]$.
Conjecture: a(n) ~ (1-EulerGamma)n.

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

@[expose] public section

namespace OeisA102722

open BigOperators Finset Int Asymptotics Filter

/-- The primary defining sequence `a`.
a n is the floor of the sum of all division remainders $\{n/k\}$, with $k=1,\dots,n$.
$$a(n) = \left\lfloor \sum_{k=1}^n \left\{ \frac{n}{k} \right\} \right\rfloor$$ -/
noncomputable def a (n : ℕ) : ℕ :=
  let sumOfFractParts : ℝ :=
    (Icc 1 n).sum fun k : ℕ =>
      -- Int.fract is the fractional part function {x}.
      fract ((n : ℝ) / (k : ℝ))
  (floor sumOfFractParts).toNat

@[category API, AMS 11]
lemma a_sum_1 (f : ℕ → ℝ) : (Icc 1 1).sum f = f 1 := by
  have h : Icc 1 1 = {1} := rfl
  rw [h, Finset.sum_singleton]

@[category API, AMS 11]
lemma a_sum_2 (f : ℕ → ℝ) : (Icc 1 2).sum f = f 1 + f 2 := by
  have h : Icc 1 2 = {1, 2} := rfl
  rw [h, Finset.sum_insert (by decide), Finset.sum_singleton]

@[category API, AMS 11]
lemma a_sum_3 (f : ℕ → ℝ) : (Icc 1 3).sum f = f 1 + f 2 + f 3 := by
  have h : Icc 1 3 = {1, 2, 3} := rfl
  rw [h, Finset.sum_insert (by decide), Finset.sum_insert (by decide), Finset.sum_singleton,
    add_assoc]

@[category API, AMS 11]
lemma a_sum_4 (f : ℕ → ℝ) : (Icc 1 4).sum f = f 1 + f 2 + f 3 + f 4 := by
  have h : Icc 1 4 = {1, 2, 3, 4} := rfl
  rw [h, Finset.sum_insert (by decide), Finset.sum_insert (by decide),
    Finset.sum_insert (by decide), Finset.sum_singleton]
  abel

@[category API, AMS 11]
lemma a_sum_5 (f : ℕ → ℝ) : (Icc 1 5).sum f = f 1 + f 2 + f 3 + f 4 + f 5 := by
  have h : Icc 1 5 = {1, 2, 3, 4, 5} := rfl
  rw [h, Finset.sum_insert (by decide), Finset.sum_insert (by decide),
    Finset.sum_insert (by decide), Finset.sum_insert (by decide), Finset.sum_singleton]
  abel

macro "eval_a" : tactic => `(tactic| (
  delta a
  simp only [a_sum_1, a_sum_2, a_sum_3, a_sum_4, a_sum_5]
  norm_num
))

/-- Term theorems verifying the first few values of the sequence against the official OEIS b-file -/
@[category test, AMS 11]
theorem a_1 : a 1 = 0 := by eval_a

@[category test, AMS 11]
theorem a_2 : a 2 = 0 := by eval_a

@[category test, AMS 11]
theorem a_3 : a 3 = 0 := by eval_a

@[category test, AMS 11]
theorem a_4 : a 4 = 0 := by eval_a

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

set_option linter.style.formal_proof_palomar false in
/-- A102722 Conjecture: $a(n) \sim (1-\gamma)n$. -/
@[category research solved, AMS 11,
  formal_proof using lean4 at
    "https://github.com/KitaKen1/oeis-102722-asymptotic/blob/0e3bf1bc6dfd04627f926b07fb8d25f4395a5072/lean/OEIS102722FC.lean#L18-L24"]
theorem conjecture :
    (fun n : ℕ => (a n : ℝ)) ~[atTop]
      (fun n : ℕ => (1 - Real.eulerMascheroniConstant) * (n : ℝ)) := by
  sorry

end OeisA102722

To prove it: keep every definition of Challenge.lean unchanged and prove OeisA102722.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-102722
nosorry submit oeis-102722 nosorry/oeis-102722/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.