# sigma 1/n up to k

Hi. I have a feeling this is kinda a known thing, but I don't know it, so hopefully you can help me out. I'm a lowly software developer.

For a given n and k, is there a short-cut way of calculating (or approximating) the value of this expression?

$\sum_{n}^{k}\frac{1}{n}$

It's a matter of computational efficiency: I have a lot of these expressions i want to calculate.

-
There are better places for getting an answer to questions such as yours; please see the faq. BTW you get crude estimates by replacing the sum with an integral. For better results, google for Euler and MacLaurin summation. – Franz Lemmermeyer May 17 '11 at 10:49
math.stackexchange is likely the right forum for your question. As is it's a little vague and perhaps pretty basic -- how good an approximation do you want? $\sum_{n=1}^k \frac{1}{n}$ is between $\ln(k+1)$ and $\ln(k)+1$. – Ryan Budney May 17 '11 at 10:54
If one really needs to compute them 'well' I am not sure this is so simple a question. – quid May 17 '11 at 10:58

If you mean that the sum starts at 1 these are exactly the Harmonic numbers, see http://en.wikipedia.org/wiki/Harmonic_number

There are well-known asymptotic expansions (see the above mentioned page for a start, and below).

For actual computation, there is a nice blogpost on computing them by Fredrik Johansson: http://fredrik-j.blogspot.com/2009/02/how-not-to-compute-harmonic-numbers.html

-
Thanks everyone: I appreciate it. Investigating harmonic series/Euler summation I found a good article on exactly what I needed (I should have said the sum for n=1 to k). For future google travellers, turns out the approximation I need is ln(n)+.5772156649... (Euler's constant) via: jimloy.com/algebra/hseries.htm – john conroy May 17 '11 at 11:31