HarmonicNumber
gives the n harmonic number
.
HarmonicNumber[n,r]
gives the harmonic number of order r.
Details

- Mathematical function, suitable for both symbolic and numerical manipulation.
- The harmonic numbers are given by
with
.
- HarmonicNumber can be evaluated to arbitrary numerical precision.
- HarmonicNumber automatically threads over lists.
- HarmonicNumber can be used with Interval and CenteredInterval objects. »
Examples
open allclose allBasic Examples (7)
Plot over a subset of the integers:
Plot over a subset of the complexes:
Series expansion at the origin:
Series expansion at Infinity:
Scope (34)
Numerical Evaluation (5)
The precision of the output tracks the precision of the input:
Evaluate efficiently at high precision:
HarmonicNumber can be used with Interval and CenteredInterval objects:
Specific Values (5)
HarmonicNumber[n,a] for symbolic a:
HarmonicNumber[n,a] for symbolic n:
Find a value of n for which HarmonicNumber[n]=1.5:
Express harmonic numbers of fractional argument in terms of elementary functions:
Visualization (3)
Plot the HarmonicNumber function:
Plot the HarmonicNumber function for various orders:
Plot the real part of HarmonicNumber:
Plot the imaginary part of HarmonicNumber:
Function Properties (11)
Real domain of HarmonicNumber:
Real range of HarmonicNumber:
HarmonicNumber threads elementwise over lists and arrays:
HarmonicNumber is not an analytic function:
HarmonicNumber is neither non-increasing nor non-decreasing:
HarmonicNumber is not injective:
HarmonicNumber is surjective:
HarmonicNumber is neither non-negative nor non-positive:
HarmonicNumber has both singularities and discontinuities for negative integers:
HarmonicNumber is neither convex nor concave:
TraditionalForm formatting:
Differentiation (3)
Integration (3)
Compute the indefinite integral using Integrate:
Series Expansions (2)
Find the Taylor expansion using Series:
Plots of the first three approximations around :
General term in the series expansion using SeriesCoefficient:
Function Identities and Simplifications (2)
Generalizations & Extensions (5)
Harmonic Numbers (2)
Applications (5)
The average number of comparisons in Quicksort:
Book stacking with the maximal overhang:
Pick the best candidate out of n candidates after x evaluated choices [more info]:
Plot as a function of harem size:
A finite sum with StirlingS1 expressed in terms of HarmonicNumber:
A finite sum with StirlingS2 expressed in terms of HarmonicNumber:
Properties & Relations (10)
HarmonicNumber can be expressed in terms of PolyGamma:
HarmonicNumber can be expressed in terms of Zeta and HurwitzZeta:
Use FullSimplify to simplify expressions containing harmonic numbers:
Generate from sums and integrals:
HarmonicNumber can be represented as a DifferenceRoot:
General term in the series expansion of HarmonicNumber:
The ordinary generating function for HarmonicNumber:
The exponential generating function for HarmonicNumber:
Possible Issues (3)
Large arguments can give results too large to be computed explicitly:

Machine-number inputs can give high‐precision results:
Results are often expressed in terms of PolyGamma instead of HarmonicNumber:
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png
RelatedLinks-Functions.png