3 (require "amb-eli.rkt")
5 (define (a-pythagorean-triple-between low high)
6 (let ((i (an-integer-between low high))
8 (let ((j (an-integer-between i high)))
9 (let ((ksq (+ (* i i) (* j j))))
17 Yes, Ben is correct. The above program prunes the search space by restricting the
22 and sqrt (i^2 + j^2) is an integer. This eliminates a large number of (i, j, k) triples
23 and hence the search space is a lot less than the naive implementation in the text.