Functional Iteration

Long used in its simplest form in mathematics, functional iteration is an elegant way to represent repeated operations. The Wolfram Language's symbolic architecture makes powerful general forms of functional iteration immediately accessible.

(RefLink[NestList, paclet:ref/NestList]) — successively nest a function: {x,f[x],f[f[x]],f[f[f[x]]],…}

(RefLink[Nest, paclet:ref/Nest]) — give the result of nesting a function: f[f[f[x]]] etc.

(RefLink[NestGraph, paclet:ref/NestGraph]) — give the graph of nesting a function

(RefLink[FoldList, paclet:ref/FoldList]) — successively fold in a list of values: {x,f[x,1],f[f[x,1],2],f[f[f[x,1],2],3],…}

(RefLink[Fold, paclet:ref/Fold]) — give the result of folding in a list of values: f[f[f[x,1],2],3] etc.

(RefLink[SequenceFold, paclet:ref/SequenceFold]), (RefLink[SequenceFoldList, paclet:ref/SequenceFoldList]) — fold allowing sequences of previous values

(RefLink[FoldPair, paclet:ref/FoldPair]), (RefLink[FoldPairList, paclet:ref/FoldPairList]) — give a result and maintain a state at each step (e.g. quotient-remainder)

(RefLink[FixedPoint, paclet:ref/FixedPoint]), (RefLink[FixedPointList, paclet:ref/FixedPointList]) — nest until a fixed point is reached

(RefLink[NestWhile, paclet:ref/NestWhile]), (RefLink[NestWhileList, paclet:ref/NestWhileList]) — nest while a condition is satisfied

(RefLink[TakeWhile, paclet:ref/TakeWhile]) — take from a list while a condition is satisfied

(RefLink[LengthWhile, paclet:ref/LengthWhile]) — the length while a condition is satisfied