2 1 + 3 2 + 4 3 + 5 4 + ⋯ + 1 0 0 9 9 = ?
Give your answer to 2 decimal places.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I couldnt do it with Harmonic numbers as i didnt knew it so i wrote a program
int n,i;
float sum=0;
cout<<"Input n=";
cin>>n;
for (i=1;i<=n;i++)
sum += (i*1.0)/(i+1);
cout<<"SUM="<<sum;
fflush(stdin);
getchar();
return 0;
OUTPUT=
1 2 3 4 |
|
or just:
1 |
|
The solution can be found by re-writing the sum as 100 - H(100) where H(100) is the 100th Harmonic number
which approximates to 100 - (Gamma + 1/2*100 + ln(100))
H(n) = Gamma + 1/2*n + ln(n) Where Gamma is the Euler-Mascheroni constant .
Well, this is not correct or exact. First, you should specify that it should only be correct to 3 decimal places.
Also, your answer is wrong. Rounded to the nearest thousandth, the answer is 94.813.
Problem Loading...
Note Loading...
Set Loading...
Relevant wiki: Harmonic Number
S = 2 1 + 3 2 + 4 3 + 5 4 + ⋯ + 1 0 0 9 9 = 1 − 2 1 + 1 − 3 1 + 1 − 4 1 + ⋯ + 1 − 1 0 0 1 = 9 9 − ( 2 1 + 3 1 + 4 1 + ⋯ + 1 0 0 1 ) = 1 0 0 − ( 1 + 2 1 + 3 1 + 4 1 + ⋯ + 1 0 0 1 ) = 1 0 0 − H 1 0 0 ≈ 1 0 0 − ln 1 0 0 − γ ≈ 9 4 . 8 2 H n is the n th harmonic number. γ ≈ 0 . 5 7 7 2 is the Euler-Mascheroni constant.