What would be the value of


Is it $H_{\sqrt{\frac{5}{2}}}$?

Using different definitions of harmonic numbers this question can be computed, but can I use the usual definition of harmonic numbers for any real numbers?

In other words is $$\sum_{k=1}^{n}\frac{1}{k}$$

A useful definition for any real $n$?

When I want to compute the value of $H_{\sqrt{\frac{5}{2}}}$ at Desmos I just define $\sum_{k=1}^{n}\frac{1}{k}$ and I don't put $\sqrt{\frac{5}{2}}$ directly at the upper limit, but I define $n=\sqrt{\frac{5}{2}}$ and the result is exactly what it should be, it seems using a simple substitution will give us the right answer, but generally are we allowed to use the regular definition of harmonic numbers when our $n$ is not necessarily a natural number?

  • $\begingroup$ I would define the $r$th harmonic number for a real number $r$ which is not a negative integer for example by $H_r = \gamma +\psi(r+1)$, where $\gamma$ is the Euler-Mascheroni constant and $\psi$ is the digamma function $\endgroup$ – Maximilian Janisch Feb 13 at 22:29
  • $\begingroup$ Things are even more complicated. Suppose you have a function of $f(n)$ in the domain of real $n$ for which $f(n) = H_n$ for positive integers $n$. Then $g(n) = f(n) + a \sin(\pi n)$ is another extension of $H_n$ to real $n$. Hence you need an additional condition to rule out $a\ne0$. $\endgroup$ – Dr. Wolfgang Hintze Feb 14 at 7:58

Indefinite Sum concept is the answer to your question.

In fact, if a function $f(x)$ is the (forward) difference of a function $F(x)$ $$ f(x) = \Delta _x F(x) = F(x + 1) - F(x) $$ then we say that $F(x)$ is the "antidifference" (or "indefinite sum") of $f(x)$ $$ F(x) = \Delta _x ^{\left( { - 1} \right)} f(x) = \sum\nolimits_x {f(x)} $$

If $ f(x)$ and $F(x)$ are defined over a real, or complex, domain for $x$ then we will have for example $$ \sum\limits_{k = 0}^n {f(x + k)} = \sum\limits_{k = 0}^n {\left( {F(x + 1) - F(x)} \right)} = F(x + n + 1) - F(x) $$

We write the above with a different symbol for the sum as $$ \sum\nolimits_{k = 0}^{\,n} {f(x + k)} = \sum\limits_{k = 0}^{n - 1} {f(x + k)} = F(x + n) - F(x) $$ which can also be written as $$ \sum\nolimits_{k = x}^{\,x + n} {f(k)} = F(x + n) - F(x) $$

The extension to $$ \sum\nolimits_{k = a}^{\,b} {f(k)} = F(b) - F(a) $$ for any real (or complex) $a,b$ inside the domain of definition of $f, F$ is quite natural.

Coming to the harmonic numbers, it is well known that the functional equation of the digamma function is $$ {1 \over x} = \Delta _x \,\psi (x) $$ and it is therefore "natural" to define $$ \bbox[lightyellow] { H_r = \sum\limits_{k = 1}^r {{1 \over k}} = \sum\nolimits_{k = 1}^{\,1 + r} {{1 \over k}} = \psi (1 + r) - \psi (1) = \psi (1 + r) + \gamma } \tag{1}$$ which substantiate M. Janisch's comment

Answering to W. Hintze's comment, please consider how the "indefinite sum" parallels the "indefinite integral - antiderivative" concept.
Similarly to $$ f(x) = {d \over {dx}}F(x)\quad \Leftrightarrow \quad F(x) = \int {f(x)dx} + c $$ we have that $$ f(x) = \Delta \,F(x)\quad \Leftrightarrow \quad F(x) = \sum\nolimits_x {f(x)} + \pi \left( x \right) $$ where now the family of antidifference functions differ by any function $\pi(x)$ , and not by a constant, which is periodic with period (or one of the periods) equal to $1$, as you rightly noticed.

So by "natural extension" I meant to say:
- an extension from integers to reals (and complex) field under the "indefinite sum" concept,
which provides a function $\mathbb C \to \mathbb C$ which fully interpolates $f(n)$;
- in the antidifference family to select the "simpliest / smoothiest" function, same as the Gamma function is selected among the functions satisfying $F(z+1)=zF(z)$ as the only one which is logarithmically convex, or which has the simplest Weierstrass representation, etc.

From the comments I could catch some skepticism as if my answer could just be an "extravagant" personal idea of mine.
That's absolutely not so, the definition in (1) is actually standardly accepted: refer to Wolfram Function Site, and in particular to this section or to the Wikipedia article.
I am just trying to enlight how we can assign a meaning to sums with bounds which are not integral and thus saying that $$ \bbox[lightyellow] { H_{\,1 + \sqrt {5/2} } = \sum\limits_{k = 1}^{\,1 + \sqrt {5/2} } {{1 \over k}} = \sum\nolimits_{k = 1}^{\,\,2 + \sqrt {5/2} } {{1 \over k}} = \psi (\,\,2 + \sqrt {5/2} ) - \psi (1) = 1.7068 \ldots } \tag{2}$$

  • $\begingroup$ I don't believe that the indefinite sum provides an answer to the question. If you believe it does, you should explain that in your answer. Just giving a link is not an adequate response. $\endgroup$ – Rob Arthan Feb 13 at 21:56
  • $\begingroup$ @RobArthan: your criticism is fully right and accepted: I expanded my answer $\endgroup$ – G Cab Feb 14 at 0:41
  • $\begingroup$ So finally can I use an irrational index for the lower or upper bound for the sum? $\endgroup$ – user715522 Feb 14 at 6:07
  • $\begingroup$ @ G Cab As to the question of what is a "natural" extension please see my comment to the OP. (and thanks for bringing indefinite sums to my attention). $\endgroup$ – Dr. Wolfgang Hintze Feb 14 at 8:03
  • $\begingroup$ @Dr.WolfgangHintze: well, the meaning of "natural extension" is .. quite natural, as much as the Gamma function is the natural extension of $(n-1)!$. That the "natural" one does not cover all the possible extensions that's absolutely true: I added some lines to make it clear which is the antidifference family of functions. $\endgroup$ – G Cab Feb 14 at 17:44

The $n$-th harmonic number $H_n=\sum_{k=1}^n\frac{1}{k}$ admits a nice representation as integral of a finite geometric series which can be generalised in a rather natural way. We have the following representation for $n$ a positive integer: \begin{align*} H_n=\sum_{k=1}^n\frac{1}{k}=\int_0^1\frac{1-t^n}{1-t}dt\tag{1} \end{align*}

The identity (1) is valid since we have \begin{align*} \int_0^1\frac{1-t^n}{1-t}dt&=\int_0^1\left(1+t+\cdots+t^{n-1}\right)\,dt\tag{2}\\ &=\left(t+\frac{1}{2}t^2+\cdots+\frac{1}{n}t^n\right)\bigg|_0^1\tag{3}\\ &=\left(1+\frac{1}{2}+\cdots+\frac{1}{n}\right)-\left(0\right)\tag{4}\\ &=H_n \end{align*}


  • In (2) we apply the finite geometric series formula.

  • In (3) we do the integration.

  • In (4) we evaluate the expression at the upper and lower limit.

The representation (1) indicates a generalisation \begin{align*} H_\color{blue}{r}=\int_0^1\frac{1-t^\color{blue}{r}}{1-t}dt\tag{2} \end{align*} for real values $r$ in fact also for complex values.


  • The formula (2) can be found in the wiki page generalized harmonic numbers.

  • We have an interesting relationship with the Digamma function $\psi(r)$ which has an integral representation \begin{align*} \psi(r+1)=\int_0^1\frac{1-t^r}{1-t}\,dt-\gamma \end{align*} which is strongly related to (2). Here $\gamma$ is the Euler-Mascheroni constant.

  • If we stick at the sigma notation, we often find for real upper limit $r$ the meaning \begin{align*} \sum_{k=1}^r a_k=\sum_{k=1}^{\lfloor r\rfloor}a_k \end{align*} where $\lfloor .\rfloor$ is the floor function.

  • $\begingroup$ You are rigt : in the "traditional" sum notation writing $\sum\limits_{k = r}^s {a_{\,k} } $ actually means $\sum\limits_{k = \,\left\lceil r \right\rceil }^{\left\lfloor s \right\rfloor } {a_{\,k} } $. That's why we need to extend the meaning passing to the antidifference and using a slightly different symbol. $\endgroup$ – G Cab Feb 15 at 22:05
  • $\begingroup$ @GCab: I think the simpler approach via the integral representation already does the job to generalize $H_n$ appropriately. $\endgroup$ – Markus Scheuer Feb 15 at 22:11
  • $\begingroup$ Definitely yes, the integral representation does the job very nicely. But I understand the core of the post as being whether and what meaning to assign to a sum with non-integral bounds $\endgroup$ – G Cab Feb 15 at 22:24
  • $\begingroup$ @GCab: Yes, I know. :-) $\endgroup$ – Markus Scheuer Feb 15 at 22:25

Your question is "are we allowed to use the regular definition of harmonic numbers when our $n$ is not necessarily a natural number?" The answer is no, since the "regular definition" of a sum is $a_1 + a_2 + ... + a_n$. Here $n$ is the number of summands which can't be a non natural number.

But you can very well give a meaning to the result of a sum. And this result may accept non integers as input.

Take the simpler example of a "sum" $a(\pi) = \text{"}\sum_{k=1}^{\pi} k\text{"}$. This "sum" is not defined, as although the first three summands are 1, 2, and 3, the last 3.14...-th summand is not defined.

Hence the definition starts by calculating the sum up to an integer $n$, and afterwards insert the non integer value for $n$. Here this gives the arithmetic sum $a(n)= \frac{1}{2}n(n+1)$, and hence $a(\pi)= \frac{1}{2}\pi(\pi+1)$.

Now for the harmonic number there is no such simple closed expression for general $n$. But here comes a relation which is valid for natural $n$: $\sum_{k=1}^n \frac{1}{k} = \sum_{k=1}^n \int_0^1 x^{k-1}\,dx=\int_0^1 \sum_{k=1}^n x^{k-1}\,dx=\int_0^1 \frac{1-x^n}{1-x}\,dx$, and now the r.h.s. is valid for also for real $n$.

Your description of the problem gives a good illustration of this procedure. In making the usual definition of the harmonic number $\sum_{k=1}^n \frac{1}{k}$ in your CAS, the system understands that you mean the harmonic number function $H_n$ it has in its "belly", and this is valid for real numbers. If you then insert a value for $n$, be it integer or not, you get the result of this internal function.

  • $\begingroup$ please, let's avoid confusions, do not use the symbol $\sum\nolimits_{k = 1}^{\,\pi } k $ in your argumentation above since it is the symbol adopted (almost standardly) for the antidifference, and $$ \sum\nolimits_{k = 1}^{\,\pi } k = {{\pi \left( {\pi - 1} \right)} \over 2} $$ ! Use instead, $$ \sum\limits_{k = 1}^\pi k = \sum\nolimits_{k = 1}^{\,\pi + 1} k = {{\pi \left( {\pi + 1} \right)} \over 2} $$ And please have a look at the renowned and authoritative "concrete Mathematics" para. 2.6 $\endgroup$ – G Cab Feb 15 at 21:48
  • $\begingroup$ You might have noticed that I have put the expression in hyphens to avoid confusion. You are free to use any symbol you like, of course, but please avoid forcing others to use your conventions. $\endgroup$ – Dr. Wolfgang Hintze Feb 16 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.