You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sicp-all-tasks/sicp/4_002e36

10 lines
523 B

Exercise 4.36: Exercise 3.69 discussed how
to generate the stream of all Pythagorean triples, with no upper bound
on the size of the integers to be searched. Explain why simply replacing
an-integer-between by an-integer-starting-from in the procedure
in Exercise 4.35 is not an adequate way to generate arbitrary Pythagorean
triples. Write a procedure that actually will accomplish this. (That is,
write a procedure for which repeatedly typing try-again would in
principle eventually generate all Pythagorean triples.)