Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

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

2 Answers 2

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).$$

share|improve this answer
    
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
    
@hhh, what does it mean to you to differentiate a function you have only defined on the integers? –  Gerry Myerson Jun 2 '11 at 1:00
    
$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

I think with a simple trick you can save 50% of the time when computing $$\sum_{i=1}^{n} 1/i$$ because you sum up only the terms with an odd denominator.

Example:

$$\sum_{i=1}^{27} 1/i$$

one rearrange the series in the following manner

$$(1+\frac{1}{2}+\frac{1}{4}+\frac{1}{8}+\frac{1}{16})*1$$

$$+(1+\frac{1}{2}+\frac{1}{4}+\frac{1}{8})*\frac{1}{3}$$

$$+(1+\frac{1}{2}+\frac{1}{4})*\frac{1}{5}$$

$$+(1+\frac{1}{2})*(\frac{1}{7}+\frac{1}{9}+\frac{1}{11}+\frac{1}{13})$$

$$+1*(\frac{1}{15}+\frac{1}{17}+\frac{1}{19})$$

$$+(\frac{1}{21}+\frac{1}{23}+\frac{1}{25}+\frac{1}{27})$$

share|improve this answer
    
a blob entry: fredrik-j.blogspot.com/2009/02/… –  miracle173 Jun 3 '11 at 9:34

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.