1

Is it possible to formulate a function that can generate the next number in the harmonic series, for instance:

When $$ y = 4,$$ $$x=1+\frac{1}{2} +\frac{1}{3}+ \frac{1}{4}\ldots$$

Thanks for your time and effort.

1 Answers1

1

$$ f(n) = \sum_{j=1}^n \frac{1}{j} $$


Okay, that's a little facetious. There are other representations and approximations of the harmonic numbers -- you can look through the answers to the question Martin R posted above, and there's a summary on Wikipedia.

But, suppose I rephrase your question like this:

Is there a function which exactly computes the $n^{th}$ harmonic number faster than simply computing the partial sum?

To my knowledge, there is not.

Neal
  • 32,659
  • This doesn't seem to do it. – Jinny Ecckle Sep 29 '19 at 17:56
  • @JinnyEcckle I edited my answer – Neal Sep 29 '19 at 18:01
  • Is there a function that generates the numbers up reasonably high y values? Say 100, or 1000? Thanks for your time!! – Jinny Ecckle Sep 29 '19 at 18:02
  • There are lots of functions that generate them up to 100 or 1000. For instance you could find the Lagrange polynomial interpolating ${ (n, H_n)\ |\ n=1,\ldots,1000}$ and use that to compute $H_n$. However it will have degree $1000$ so evaluating will use about as many computations as simply adding $1+\frac{1}{2} + \frac{1}{3} + \cdots$. – Neal Sep 29 '19 at 19:07
  • Thank you! I'm using it for to make an expression for graphing; so, I need an actual function. Is there a more compacted way to do it? – Jinny Ecckle Sep 29 '19 at 19:13
  • $H_n = \sum_{j=1}^n \frac{1}{j}$ is an actual function. – Neal Sep 29 '19 at 19:55