Numbers that can be expressed as the sum of two cubes in more than one way are sometimes called Ramanujan numbers , in honor of the mathematician Srinivasa Ramanujan. Ordered streams of pairs provide an elegant solution to the problem of computing these numbers. Write a procedure to generate the Ramanujan numbers. The first such number is 1,729. In fact, we can use streams to model signal-processing systems in a very direct way, representing the values of a signal at successive time intervals as consecutive elements of a stream.
Figure is a picture of a signal-processing system that corresponds to the integral procedure.
The input stream is scaled by dt and passed through an adder, whose output is passed back through the same adder. The self-reference in the definition of int is reflected in the figure by the feedback loop that connects the output of the adder to one of the inputs. We can model electrical circuits using streams to represent the values of currents or voltages at a sequence of times. For instance, suppose we have an RC circuit consisting of a resistor of resistance R and a capacitor of capacitance C in series. Write a procedure RC that models this circuit.