I'd like to know if someone is aware of a record in factorial calculations
resulting in huge numbers (1000! and above)
Two years ago I have built a very fast algorithm, which can compute huge
factorial results, and would like if a record is established.
Thanks in advance !
Joėl
>I'd like to know if someone is aware of a record in factorial calculations
>resulting in huge numbers (1000! and above)
>Two years ago I have built a very fast algorithm, which can compute huge
>factorial results, and would like if a record is established.
1000! takes longer to print than it does to compute, using Mathematica on
my Mac. It begins printing almost instantaneously, but takes a couple
seconds to finish. Surely a record computation should at least keep the
computer busy long enough for you to get a cup of coffee.
--
Dave Seaman dse...@purdue.edu
Amnesty International says Mumia Abu-Jamal decision falls short of justice.
<http://www.amnestyusa.org/news/2001/usa12192001.html>
> Joël Bourquard <j...@esecurium.com.nospam> wrote:
>
> >I'd like to know if someone is aware of a record in factorial
calculations
> >resulting in huge numbers (1000! and above)
>
> >Two years ago I have built a very fast algorithm, which can compute huge
> >factorial results, and would like if a record is established.
>
> 1000! takes longer to print than it does to compute, using Mathematica on
> my Mac. It begins printing almost instantaneously, but takes a couple
> seconds to finish. Surely a record computation should at least keep the
> computer busy long enough for you to get a cup of coffee.
I was going to post something similar, except I used bc on a Linux box.
I've just had it calculate 1000000! using sums of logs (therefore it's a bit
of an approximation), with no optimisations whatsoever. It took ~45 mins (I
was having a coffee so I didn't notice it finish :) ).
This code:
scale=10;t=0;for(i=1;i<=1000000;i++)t+=l(i);t/=l(10);it=int(t);t=power(10,t-
it);print t,"e+",it,"\n"
returned this:
8.2678449060e+5565708
Can someone confirm the accuracy of this?
*** Of course all of this tomfoolery is academic. A decent
Gamma-approximator should return any factorial in no time at all...
Carl
PS ICYWW int() and power() aren't standard bc. I've had to write them.
Anyone know of a place where I can get bc libraries?
>In article <3c501d1d$1...@news.deckpoint.ch>,
>Joël Bourquard <j...@esecurium.com.nospam> wrote:
>
>>I'd like to know if someone is aware of a record in factorial calculations
>>resulting in huge numbers (1000! and above)
>
>>Two years ago I have built a very fast algorithm, which can compute huge
>>factorial results, and would like if a record is established.
>
>1000! takes longer to print than it does to compute, using Mathematica on
>my Mac. It begins printing almost instantaneously, but takes a couple
>seconds to finish. Surely a record computation should at least keep the
>computer busy long enough for you to get a cup of coffee.
Heck, I can compute it instantaneously (and see the first ten digits)
if I compute 1000! recursively in _Python_, which seems like a pretty
slow way to do it.
(Didn't try to print it all in the Windows Python thingie I use...
I can also save the whole thing to a file instantaneously. Then
it turns out that my favorite text editor tends to crash the system
if I try to open a file containing a line more than a few thousand
characters long...)
>--
>Dave Seaman dse...@purdue.edu
>Amnesty International says Mumia Abu-Jamal decision falls short of justice.
><http://www.amnestyusa.org/news/2001/usa12192001.html>
David C. Ullrich
You can use Stirling's approximation, but a better one is Gosper's
(number 3. below):
1. n! ~= (n^n)e^(-n) =
3.296831473779587525702*10^5565705
2. n! ~= sqrt(2 Pi)*n^(n+1/2)e^(-n) =
8.263930996566422941576402*10^5565708
3. n! ~= sqrt[(2n + 1/3)*Pi]*(n^n)*(e^(-n)) = (
8.263931677530192504846745*10^5565708
That is, your approximation is pretty good!
Also, you could use an exact symbolic calculator like mathematica
(on my PIII w/WNT), this took 7 minutes (too ... too long to post)!
HTH, Flip
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
> I'd like to know if someone is aware of a record in factorial calculations
> resulting in huge numbers (1000! and above)
Once upon a time - back in the 1950s, maybe a bit earlier - there was
a journal called Scripta Mathematica which actually published stuff
like this - all the digits of n-factorial, for values of n large enough
for the answer to take up several pages in the journal.
They published some useful stuff, too, but what I remember is
the pages full of digits.
Gerry Myerson (ge...@mpce.mq.edu.au)
??? You're not doing justice to Gosper's approximation. In fact it gives
8.26393168833118*10^5565708, getting the 13 most significant digits of
(10^6)! correct. Can anyone here give me more information about Gosper's
approximation?
If you want a more accurate approximation, you can use a portion of my
new convergent expansion for the gamma function as given at
<http://mathforum.org/epigone/sci.math.num-analysis/zonchahee>.
In fact, if you completely ignore the continued fraction (called CF there),
you get that n! is approx.
Sqrt(2*Pi)*((n+1/2)/e)^(n+1/2)*(48*n+23)/(48*n+25)
Using n = 10^6 this gives an approximation of which the 20 most significant
digits are correct: 8.2639316883312400623565*10^5565708, as compared with
precisely (10^6)! = 8.2639316883312400623766...*10^5565708 .
David W. Cantrell
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
I should have said, I was not meaning approximations, but Integer answers..
For example, I did 1,000,000 ! :-)
The result is then stored in base 16... For 1000000! it makes a 4+ megabyte
file.
Note: 1000! takes long to display in Mathematica, because of the radix
conversion (base 2^n => base10).
Joėl
"Carl W." <ro...@127spam.0.0.1> wrote in message
news:3c503...@katana.legend.co.uk...
> "Dave Seaman" wrote:
And there was Dan Shanks' Unpublished Mathematical Tables at
Mathematics of Computation. I wonder if the UMT is still around...
Pongo