Take the 2-minute tour ×
MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

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.

share|improve this question
    
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
1  
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
1  
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

1 Answer 1

up vote 3 down vote accepted

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

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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