Harmonic numbers and harmonic sums

Harmonic, hyperharmonic and multiple harmonic sums, binomial-harmonic identities, non-integrality, harmonic congruences, Euler–Mascheroni bounds.

DefinitionHigher-order harmonic numbers#✓fully proved

For natural numbers \(n\) and \(r\), the harmonic number of order \(r\) is the rational number \(H_n^{(r)} = \sum_{k=1}^{n} 1/k^r\).

def higherHarmonic (n r : Nat) : Rat :=
  ∑ k ∈ Finset.Icc 1 n, (1 : Rat) / ((k : Rat) ^ r)
Used by 2

TheoremSums of harmonic numbers starting from the second are not integers#✓fully proved

For every natural number \(n \ge 2\), the sum \(\sum_{\nu=2}^{n} H_\nu\) is not an integer, where \(H_\nu = \sum_{j=1}^{\nu} 1/j\) is the \(\nu\)-th harmonic number, viewed as a rational number.

The source proves this via its identity \(\sum_{\nu=2}^n H_\nu = (n+1)(H_n - 1)\) (equation (1.2)), reducing to the non-integrality of \((n+1) H_n\), in the spirit of Theisinger's theorem that \(H_n\) itself is never an integer for \(n > 1\).

theorem harmonic_partial_sum_not_int
    (n : ℕ) (hn : 2 ≤ n) :
    ¬ ∃ k : ℤ, (k : ℚ) = ∑ ν ∈ Finset.Icc 2 n, harmonic ν
Sources
  • Horst Alzer and Man Kam Kwong, "Ramanujan and a Combinatorial Identity Involving Harmonic Numbers," Journal of Integer Sequences 29 (2026), Article 26.4.8, Theorem, lines 460–462, https://cs.uwaterloo.ca/journals/JIS/VOL29/Alzer/alzer22.tex
2 fully proved

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.