NestList

NestList[f,expr,n]

gives a list of the results of applying f to expr 0 through n times.

Details

  • NestList[f,expr,n] gives a list of length n+1.

Examples

open allclose all

Basic Examples  (2)

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

The function to nest can be a pure function:

In[1]:=
Click for copyable input
Out[1]=

Scope  (3)

Generalizations & Extensions  (1)

Applications  (15)

Properties & Relations  (5)

Neat Examples  (4)

See Also

Nest  NestGraph  NestWhileList  FoldList  FixedPointList  ComposeList  SubstitutionSystem

Tutorials

Introduced in 1988
(1.0)