# Find fast exact value for numbers in the form $\sum_{k=min}^{Max}\frac{1}{k}$

I know I could start multiplying by all denominators and try to get the exact value that way but is there some smarter way or shortcut?

Let's take simple example: $\displaystyle \frac{1}{99}+\frac{1}{98}+...+1$. How to approximate or to get the exact value fast?

I know I could split the sequence into sum of geometric series like $$s_{2}=\frac{1}{2}+\frac{1}{4}+...=2,\qquad s_{3}=\frac{1}{3}+\frac{1}{9}+...=\frac{3}{2},$$ but there can be an infinite amount of them if $Max$ is infinite.

-
If Max is infinite then the sum diverges. –  Yuval Filmus Jun 2 '11 at 0:07
Your "simple example" isn't an example, as min is 1 and max is 99 but everything between 1 and 98 is missing. What do you really mean? –  Gerry Myerson Jun 2 '11 at 0:37
@Gerry Myerson: sorry forgot the dots, corrected. –  hhh Jun 2 '11 at 0:47
OK, then Yuval has given you a good answer. $\sum_1^n(1/k)=\log n+\gamma+$ terms of lower order, where $\gamma=.57721\dots$ is the Euler-Mascheroni constant. A websearch for gamma, or Euler-Mascheroni, or harmonic number, will get you tons of information. –  Gerry Myerson Jun 2 '11 at 1:04

You can use the formula $\sum_{k=l+1}^h 1/k = H_h - H_l$ together with estimates for the harmonic number (here $H_t$ is the $t$th harmonic number). This gives for example the estimate $$\sum_{k=l+1}^h = \ln \frac{h}{l} + O\left(\frac{1}{l}\right).$$
A good answer, but hhh should note that it's not very useful if the number of terms in the sum is small compared to $h$. In that case one has $(h-l)/h\lt\sum\lt(h-l)/(l+1)$. –  Gerry Myerson Jun 2 '11 at 0:40
$Plot( HarmonicNumber(100) -HarmonicNumber(n), n, 0,99)$...now I need to find the inflexion point of this...trying to plot the derivatives in terms of n. –  hhh Jun 2 '11 at 1:41
You keep talking of derivatives, but what does derivative of $f(x)$ mean to you, if $f(x)$ is only defined for $x=1,2,3,\dots$? The definition of $f'(a)$ requires $f(x)$ to be defined for all real $x$ near $a$, you can't even get started if $f(x)$ is only defined at integer values of $x$. –  Gerry Myerson Jun 2 '11 at 3:30
@Gerry Myerson: ...like $d/dn(H_{n}) = 1/6 (pi^{2}-6 H_{n}^{2})$ and $D[D[HarmonicNumber[n], n],n] = 2 (H_{n}^{3}-zeta(3))$ where $z$ is the Riemann zeta function. I want to do that on paper fast. I am trying to analyze the sums. For example, I have this kind of $H_{100}-H_{n}$ return/cost -relationship where $n$ stands for the number of cottages and $H_{100}$ for the maximum and to find the best amount of cottages I need to know how to analyze it. Since it does not have inflexion points or zero values with derivatives, I am confused. –  hhh Jun 2 '11 at 19:24