according to Wikipedia, n# ~= e^n , which is neat.
we calculate an approximation of e by computing (2^22)# = 4194304# , a 1820662-digit number, then take its 2^22th root:
? s=1; n=22; forprime(p=1,2^n,s*=p); for(i=1,n,s=sqrt(s)); s
time = 25,123 ms.
2.7169361789139649491006308820480538380
(this is a terribly inefficient way of calculating e.)
although n# ~= exp(n), or log(n#) ~= n, what are the next terms of the asymptotic expansions, analogous to Stirling's approximation to factorial?
No comments :
Post a Comment