Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Perform a folding operation while also parsing the index as the third argument
ResourceFunction["FoldIndexedList"][f,x,{a,b,…}] gives {x,f[x,a,1],f[f[x,a,1],b,2],…}. | |
ResourceFunction["FoldIndexedList"][f,{a,b,c,…}] gives {a,f[a,b,1],f[f[a,b,1],c,2]}. | |
ResourceFunction["FoldIndexedList"][f] represents an operator form of ResourceFunction["FoldIndexedList"] that can be applied to expressions. |
Map a function over a list including the index:
| In[1]:= |
| Out[1]= |
Without an initializer, the first element of list is the initializer:
| In[2]:= |
| Out[2]= |
Make an operator:
| In[3]:= |
| Out[3]= |
Feed a single list to the operator:
| In[4]:= |
| Out[4]= |
Feed an initializer and a list to the operator:
| In[5]:= |
| Out[5]= |
Form a continued fraction with increasing power:
| In[6]:= |
| Out[6]= | ![]() |
Form a continued fraction with an increasing numerator:
| In[7]:= |
| Out[7]= | ![]() |
Form the product
:
| In[8]:= |
| Out[8]= |
This work is licensed under a Creative Commons Attribution 4.0 International License