NestList

Command: NestList


Synopsis
x f n NestList -> [x x f x f f ... x f1 ... fn]
File
lib/sli/mathematica.sli
Parameters
x - any object to which f can be applied
f - an executable object.
Description
NestList repeatedly applies f to the supplied argument and returns
the result als well as all intermediate results in a list.
Note that f must expect and return exactly one argument.
Examples
1 {2 mul} 3 NestList -> [1 2 4 8]

SeeAlso