harmonic_number( *n*, *m* )

The generalized harmonic number function in SageMath. Defined by

\[ H_{n,m} = \sum_{k=1}^n \frac{1}{k^m} \]When called with one argument, the second defaults to unity and the function returns the harmonic numbers

\[ H_n = \sum_{k=1}^n \frac{1}{k} \]Plot on the real axis:

Series expansion about the origin:

Special values:

Related functions: log

Function category: functions sagemath-docs