This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Functional Iteration
Long used in its simplest form in mathematics, functional iteration is an elegant way to represent repeated operations. Mathematica's symbolic architecture makes powerful general forms of functional iteration immediately accessible.
NestList successively nest a function: {x, f[x], f[f[x]], f[f[f[x]]], ...}
Nest give the result of nesting a function: f[f[f[x]]] etc.
FoldList successively fold in a list of values: {x, f[x, 1], f[f[x, 1], 2], f[f[f[x, 1], 2], 3], ...}
Fold give the result of folding in a list of values: f[f[f[x, 1], 2], 3] etc.
FixedPoint, FixedPointList nest until a fixed point is reached
NestWhile, NestWhileList nest while a condition is satisfied
TakeWhile take from a list while a condition is satisfied
LengthWhile the length while a condition is satisfied