SICP Solutions

Chapter 3, Modularity, Objects, and State

Exercise 3.55

Denoting the terms of the series as $\, P_1, P_2, ... P_i ... \,$ and denoting the series from which we generate as $\, S_1, S_2, ... S_i ..., S_n \,$. Then the series can be defined as:

\, \begin{align*} P_0 &= S_0 \\ P_{i+1} &= P_{i} + S_{i+1} \\ \end{align*} \,

Now, its simple to write the procedure:

Output: