1 (require (only (lib "1.ss" "srfi") filter))
\r
3 (define (numbers a b)
\r
5 (else (cons a (numbers (add1 a) b)))))
\r
7 (define (cross l1 l2)
\r
10 (append (map (lambda (x)
\r
13 (cross (cdr l1) l2))))
\r
18 (define (try-ptriplet sum)
\r
19 (define ab (filter (lambda (x)
\r
20 (< (car x) (cdr x)))
\r
21 (cross (numbers 1 sum)
\r
23 (define abc (map (lambda (x)
\r
26 (list a b (- sum (+ a b)))))
\r
29 (define triplets (filter (lambda (x)
\r