This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Functional Programming  /
NestList

  • NestList[ f , expr , n ] gives a list of the results of applying f to expr 0 through n times.
  • Example: NestList[f, x, 3].
  • NestList[ f , expr , n ] gives a list of length n + 1.
  • See the Mathematica book: Section 2.2.2.
  • See also: FoldList, ComposeList.

    Further Examples

    This nests the function f four times starting with initial value x.

    In[1]:=

    Out[1]=

    This gives some indication of just how slowly the sine function approaches its fixed point at zero.

    In[2]:=

    Out[2]=