
-----------------------------------
zero-impact
Thu Nov 26, 2009 4:35 pm

Another Math Question
-----------------------------------
Hey guys, I need math help again.

http://upload.wikimedia.org/math/4/f/1/4f1b3c25918c64066f4e69245ada8e56.png

I need an easy way to calculate [url=http://en.wikipedia.org/wiki/Harmonic_number]Harmonic Numbers and after some research I found the above equation.

where &#947; is the Euler?Mascheroni constant and &#949;k approaches 0 as k goes to infinity. 

It work well for large values (such as 2000) if I ignore the &#949;k. But for small ones it is a bit off (which is why the &#949;k  is there I assume). My problem is I'm not sure what value to set for &#949;k for any k.

This is personal interest stuff so don't worry that you are doing my homework or anything.

-----------------------------------
A.J
Thu Nov 26, 2009 7:11 pm

RE:Another Math Question
-----------------------------------
Well, all that is saying is that the limit (ln(n) - H(n) + Euler?Mascheroni] = 0, where H(n) is the nth harmonic number.

In other words, the two sides are never equal, although they get closer as n tends to infinity.

And no integral or sum (finite or infinite) can be considered a closed form for the harmonic numbers.

-----------------------------------
Brightguy
Thu Nov 26, 2009 8:14 pm

Re: Another Math Question
-----------------------------------
The Wikipedia page gives the expansion:

H_n = ln(n) + &gamma; + 1/(2n) - 1/(12n^2) + 1/(120n^4)

This over-estimates H_n by no more than 1/(252n^6) (via The Art of Computer Programming).

-----------------------------------
A.J
Thu Nov 26, 2009 8:27 pm

RE:Another Math Question
-----------------------------------
The 'ek' is just the amount it is off by the actual value (an epsilon). Once again, all these are merely estimates. There is no closed function for the harmonic numbers.

-----------------------------------
zero-impact
Thu Nov 26, 2009 8:58 pm

RE:Another Math Question
-----------------------------------
Thanks, that makes perfect sense :) For my purposes it makes almost no difference after n becomes bigger than 5 anyways.

-----------------------------------
A.J
Thu Nov 26, 2009 9:30 pm

RE:Another Math Question
-----------------------------------
Oh, then manually compute the values...

-----------------------------------
zero-impact
Thu Nov 26, 2009 10:14 pm

RE:Another Math Question
-----------------------------------
No, what I'm using it for is really only useful at larger values. I really don't feel like summing 1/1+1/2+1/3+...+1/998+1/999+1/1000
:P

-----------------------------------
bbi5291
Fri Nov 27, 2009 12:05 am

Re: Another Math Question
-----------------------------------
That's what computers are for. You know how to code; now apply it.

-----------------------------------
A.J
Fri Nov 27, 2009 12:19 pm

RE:Another Math Question
-----------------------------------
long double sum = 0;
for (int i = 1; i < 1001; i++)
sum += (long double)1/i;

-----------------------------------
zero-impact
Sat Nov 28, 2009 10:49 pm

RE:Another Math Question
-----------------------------------
yes, of course I do. But that's not the point. Thanks for the help anyways guys! :)

-----------------------------------
qmanjr5
Tue Dec 01, 2009 8:21 pm

RE:Another Math Question
-----------------------------------
D: 
e=mcsquared? :D

-----------------------------------
A.J
Wed Dec 02, 2009 1:57 pm

RE:Another Math Question
-----------------------------------
er...qmankr5, just trying to get your # of posts up, I am assuming.
