< Back to IRCAM Forum

An elegant way to add successive elements in a list

given a list (0 2 5 8), what is an elegant way to add successive elements, producing a new list. For example, the new list would be:

0 (not changed)
0 + 2 = 2
2 + 5 = 7
7 + 8 = 15

The new list would be (0 2 7 15)

Thanks!

Hi das,

the simplest way:
history - When was the beginning of polyphony? - Music Practice & Theory Stack Exchange

Best
K

1 Like

Thank you so much K.