IfSolutions that take the f as a list of coefficients will probably be the most interesting, but if you are able to take f as an actual function, thereby (thereby reducing this challenge to the trivial "apply a function n times"), pleasefeel free to include ait after your non-trivial version where you take a list of coefficientssolution.