ok, so the docstring reaveals (1) that the pari version is "by far the fastest" as I suspected, but also that for n>50000 that we use a gp interface rather than the pari library " since the C-library interface to PARI is limited in memory for individual operations" -- whatever that means!
That might explain David's timing observations. I tihnk the pari implementation is actually quite simple (and there is a huge amount about Berouilli nos in Henri Cohen's latest book too) which suggests that doing a cython implementation would not be hard. Maybe this is time for a repeat performance of the partitions competition with M**ca! John 2008/5/2 John Cremona <[EMAIL PROTECTED]>: > I might take a look at this, as there are some ways fo computing B nos > which are very much faster tha others, and not everyone knows them. > Pari has something respectable, certainly. > > John > > 2008/5/2 mhampton <[EMAIL PROTECTED]>: > > > > > > It takes about 30 seconds on my machine to get the 10^5 Bernoulli > > number. The mathematica blog says it took a "development" version of > > mathematica 6 days to do the 10^7 calc. So it would probably take > > some work, but we are not that badly off as is. > > > > -M. Hampton > > > > On May 2, 12:34 pm, Fredrik Johansson <[EMAIL PROTECTED]> > > wrote: > > > > > Oleksandr Pavlyk reports on the Wolfram Blog that he has computed the > > > 10 millionth Bernoulli number using > Mathematica:http://blog.wolfram.com/2008/04/29/today-we-broke-the-bernoulli-recor... > > > > > > > > > > How does sage's Bernoulli number implementation compare? I'd like to > > > see bernoulli(10^7) in sage beating Mathematica's time. And then > > > computing the 20 millionth Bernoulli number... > > > > > > Fredrik > > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---