This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Accumulate

Accumulate[list]
gives a list of the successive accumulated totals of elements in list.
  • If list has length n, then Accumulate[list] will have the same length.
  • Accumulate[list, Method->"CompensatedSummation"] uses compensated summation to reduce numerical error in the result.
Cumulative sums:
Accumulate within columns:
Cumulative sums:
In[1]:=
Click for copyable input
Out[1]=
 
Accumulate within columns:
In[1]:=
Click for copyable input
Out[1]=
The head does not need to be List:
Triangular numbers:
Random walk:
Idealized random mountainside:
Cumulative sums of terms in a series:
Differences is almost the inverse of Accumulate:
Accumulate is equivalent to a particular case of FoldList:
Use Sum to symbolically accumulate sequences:
Diagonals of Pascal's triangle:
New in 6 | Last modified in 7