Revision history [back]

Iterated functional composition

I try to translate a Maple function computing OEIS A144150 as given in [1]:

g := proc(p) local b;
b := proc(n) option remember; local k;
if(n=0,1,add(binomial(n-1,k-1)*p(k)*b(n-k),k=1..n))
end end:

A144150 := (n, k) -> (g@@k)(1)(n);

seq(print(seq(A144150(n,k),k=0..8)),n=0..5);


I am somewhat clueless how to achieve this with Sage. Google found [2] which highlights the problem but does not give an answer.

[1] http://oeis.org/A144150