Chapter 3: Problem 21
Write a procedure triples that takes three infinite streams, \(S, T\), and \(U\), and produces the stream of triples \(\left(S_{i}, T_{j}, U_{k}\right)\) such that \(i \leq j \leq k\). Use triples to generate the stream of all Pythagorean triples of positive integers, i.e., the triples \((i, j, k)\) such that \(i \leq j\) and \(i^{2}+j^{2}=k^{2}\).
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.