Recursively applied 1D function

This great post by @FedericoStra, might be of interest.
Applying it to OP’s case:

g(x) = x^2
Gn(x, n) = foldl((y,_) -> g(y), 1:n; init=x)
Gn(1.001, 10)
2.7828855056543795
2 Likes