Function Repository Resource:

RightComposeIndexedList

Source Notebook

Nest an indexed list of functions to apply to an argument

Contributed by: Wolfram Staff

ResourceFunction["RightComposeIndexedList"][{f1,f2,f3,},x,{i,j,k,}]

gives {x,fi[x],fj[fi[x]],fk[fj[fi[x]]],}.

Details

ResourceFunction["RightComposeIndexedList"][flist,x,ilist] gives a list of length Length[ilist]+1.

Examples

Basic Examples (1) 

Construct iterates from composing with a list of three functions:

In[1]:=
ResourceFunction[
 "RightComposeIndexedList"][{f, g, h}, x, {1, 1, 2, 3, 1, 2}]
Out[1]=

Scope (1) 

Use a list of pure functions:

In[2]:=
ResourceFunction[
 "RightComposeIndexedList"][{#^2 + 1 &, 1 - # &, Sqrt[#] &}, 2., {3, 2, 1, 3, 2, 3}]
Out[2]=

Version History

  • 1.0.0 – 15 February 2023

Related Resources

License Information