sicp-ex-4.36



<< Previous exercise (4.35) | Index | Next exercise (4.37) >>


meteorgan

  
  
  
  
 (define (a-pythagorean-triple-greater-than low) 
         (let ((k (an-integer-starting-from low))) 
          (let ((i (an-integer-between low k))) 
           (let ((j (an-integer-between i k))) 
             (require (= (+ (* i i) (* j j)) (* k k))) 
                 (list i j k))))) 
  

squeegie

  
  
  
 ;shorter, but very inefficient! 
  
 (define (a-pythagorean-triple-greater-than low) 
         (let ((high (an-integer-starting-from low))) 
                 (a-pythagorean-triple-between 1 higher)))