Ask Your Question

Iterated functional composition

asked 2012-03-01 05:59:12 +0100

petropolis gravatar image

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;
end end: 

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


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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-03-01 12:57:23 +0100

niles gravatar image

Does this StackOverflow queston on repeated function application solve your problem?

Python's while/yield generator syntax might also be useful for this.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-03-01 05:59:12 +0100

Seen: 856 times

Last updated: Mar 01 '12