On 7/25/07, Alec Mihailovs <alec@mihailovs.com> wrote:
Here is the related part of William Stein's post in sage-devel:
-------------------Start of the (edited) quote------------------ ... Nick Alexander wrote an optimized native SAGE function that computes *all* bell numbers up to n very quickly, much more quickly than Gap computes even one!
Presumably then the algorithm used here is the usual recursion B^(n+1) = (B+1)^n. [In this range, recursion seems to run consistently 4x slower than Dobinski --- the apparent consistency of this factor is unexpected!].
sage: time v=expnums(1001,1) # this computes *all* Bell numbers up to Bell(1000) CPU times: user 0.12 s, sys: 0.00 s, total: 0.12 s Wall time: 0.13 ...
Since most of the time should be taken up by multi-precision arithmetic, it's hard to understand why using "native SAGE" (Python) makes any difference --- surely only the MP package driving the hardware can manage that.
How do you compute BellB in Mathematica?
I get
In[2]:= BellB[1000] Out[2]= BellB[1000]
-- William
Something missing here? It would be interesting to know which algorithms other programmers use! Fred Lunnon