Computes the n iterates of f with respect to a dynamical system