This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# HarmonicNumber

 HarmonicNumber[n]gives the n harmonic number . HarmonicNumbergives the harmonic number of order r.
• Mathematical function, suitable for both symbolic and numerical manipulation.
• The harmonic numbers are given by with .
First ten harmonic numbers:
Plot harmonic numbers:
Carry out sums involving harmonic numbers:
First ten harmonic numbers:
 Out[1]=

Plot harmonic numbers:
 Out[1]=

Carry out sums involving harmonic numbers:
 Out[1]=
 Scope   (8)
Evaluate exact values at large arguments:
Non-integer arguments:
Complex arguments:
Evaluate to high precision:
The precision of the output tracks the precision of the input:
HarmonicNumber threads element-wise over lists and arrays:
Series expansion at any point:
Series expansion at infinity:
HarmonicNumber can be applied to power series:
Evaluate at exact arguments:
Series expansion at any point:
Series expansion at infinity:
 Applications   (4)
The average number of comparisons in Quicksort:
Plot over the complex plane:
Book stacking with the maximal overhang:
Picking the best candidate out of n after x evaluated choices []:
Evaluate for n=100:
Plot as a function of harem size:
Use FullSimplify to simplify expressions containing harmonic numbers:
Expand in simpler functions:
Sums:
Generate from sums and integrals:
Generating function:
Large arguments can give results too large to be computed explicitly:
Machine-number inputs can give high-precision results:
Often results are expressed in PolyGamma instead of HarmonicNumber:
New in 4