each successor term
is the result of adding a fixed constant to
. Here is a concrete example, matched up with the natural numbers:
Here the starting point is 3 and the constant is 5. From these two facts, called starting point and summand, respectively, all other terms in the sequence can be determined.
Exercise 23.2.1
Develop the recursive function a-fives, which consumes a natural number and recursively determines the corresponding term in the above series. Solution
Exercise 23.2.2
Develop the non-recursive function a-fives-closed. It consumes a natural number and determines the corresponding term in the above series. A non-recursive function is sometimes called a closed form. Solution
Exercise 23.2.3
Use series to determine the sum of the a-fives sequence for the bounds 3, 7, and 88. Can an infinite arithmetic series have a sum? Solution
Exercise 23.2.4
Develop the function seq-a-fives, which consumes a natural number n and creates the sequence of the first n terms according to a-fives or a-fives-closed. Hint: Use build-list. Solution
Exercise 23.2.5
Develop arithmetic-series. The function consumes two numbers:
start and s. Its result is a function that represents
the arithmetic series whose starting point is start and whose
summand is s. For example, (arithmetic-series 3 5)
yields a-fives (or a-fives-closed). Similarly,
(arithmetic-series 0 2) produces a function that represents the
series of even numbers. Solution