Unique pairs

Define a procedure unique-pairs that, given an integer n, generates the sequence of pairs (i,j) with 1 ≤ j < i ≤ n. Use unique-pairs to simplify the definition of prime-sum-pairs given above.


There are no comments yet.

Authentication required

You must log in to post a comment.

Login
(check-equal? (unique-pairs 2) '((2 1)))
(check-equal? (length (unique-pairs 2)) 1)
(check-equal? (length (unique-pairs 3)) 3)
(check-equal? (length (unique-pairs 6)) 15)