

FoldList
Details

- FoldList[Plus,0,list] generates cumulative sums of the elements in list.
- With a length n list, FoldList generates a list of length
. »
- The head of list in FoldList[f,x,list] need not be List.
- FoldList[f][list] is equivalent to FoldList[f,list].
- FoldList[f][x,list] is equivalent to FoldList[f,x,list].
Examples
open all close allBasic Examples (6)
Generalizations & Extensions (2)
Applications (15)
Compute successive factorials:
Compute products of successive primes:
Build up a continued fraction:
Build up a nested polynomial (Horner form):
Build up a number from digits:
Find the running maximum of a list:
Find successively deeper parts in an expression:
Successively append to a list:
Build up a left-branching binary tree:
Compute a power using a power tree with successive squaring:
Properties & Relations (5)
Possible Issues (1)
See Also
Fold FoldPairList SequenceFoldList Accumulate Differences Ratios NestList ComposeList ExponentialMovingAverage Partition MapIndexed AnglePath
Function Repository: FoldIndexedList FoldRightList FoldThreadList
Tech Notes
Related Guides
History
Introduced in 1991 (2.0) | Updated in 2012 (9.0) ▪ 2016 (11.0)
Text
Wolfram Research (1991), FoldList, Wolfram Language function, https://reference.wolfram.com/language/ref/FoldList.html (updated 2016).
CMS
Wolfram Language. 1991. "FoldList." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/FoldList.html.
APA
Wolfram Language. (1991). FoldList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FoldList.html
BibTeX
@misc{reference.wolfram_2025_foldlist, author="Wolfram Research", title="{FoldList}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/FoldList.html}", note=[Accessed: 11-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_foldlist, organization={Wolfram Research}, title={FoldList}, year={2016}, url={https://reference.wolfram.com/language/ref/FoldList.html}, note=[Accessed: 11-August-2025]}