This site is supported by donations to The OEIS Foundation.

Talk:Bernoulli numbers

From OeisWiki
Jump to: navigation, search

Asymptotic expansion

Daniel, please note that

and

are two completely different formulas: the first one is of little value. To understand this look at

def b(n) :
   return (2*factorial(n)/(2*pi)^n)*((120*n^2+9)/(120*n^2-1))^n
   
[float(b(2*n)/bernoulli(2*n)) for n in (10..20)]

[-1.0041740527194414, 1.003794560676333, -1.0034779959334612,
1.0032100966319175, -1.0029804930839448, 1.0027815352822602,
-1.0026074752327152, 1.0024539155972183, -1.0023174363794525,
1.0021953380650064, -1.0020854614872228]

versus

def b1(n) :
    return 2*sqrt(2*pi*n)*(n/(2*pi*exp(1)))^n*((120*n^2+9)/(120*n^2-1))^n
   
[float(b1(2*n)/bernoulli(2*n)) for n in (10..20)]    

[-0.99999904583532406, 0.99999976142311553, -0.99999994030995587, 
0.99999998504357346, -0.99999999623677793, 0.9999999990418349, 
-0.99999999974773113, 0.99999999992743638, -0.99999999997466005, 
0.99999999998812938, -0.99999999999272038]

If you interpret the figures rightly you see a /big/ difference in the efficiency of the two formulas. Moreover, in the first formula the factorial still has to be computed, which is not trivial (think of applications in astrophysics where n might be 10^9 for example) whereas the second formula does not require this. This is an important difference. Note that you can /not/ achieve the efficiency of the second formula by just using additionally (say) Stirling's formula for the factorial.

Second, if you think that the first formula deserves mention at all, please take care to put your comment in a separate context as it is /not/ a formula by the author indicated. (Edit: Added signature Peter Luschny 05:52, 20 April 2012 (UTC))

The two are, of course, mathematically equivalent. If you want them to be inequivalent you'll need to replace the with = and add an error term. Charles R Greathouse IV 18:01, 21 April 2012 (UTC)
I see that your asymptotic formula gives much better approximations! — Daniel Forgues 20:18, 21 April 2012 (UTC)

The fact that the formulas are mathematical equivalent does not make

less arbitrary or useful. I deleted this math monster. Peter Luschny 05:12, 23 April 2012 (UTC)

I have moved some further comments by me to User:Peter_Luschny/ComputationAndAsymptoticsOfBernoulliNumbers#Asymptotic_approximations_of_the_Bernoulli_numbers. Peter Luschny 10:15, 17 June 2012 (UTC)

Bernoulli Polynomials

The Pari/GP script to compute these is at BP.--Bill McEachen 02:41, 31 August 2014 (UTC)