灯下 登录
计算机科学 / SICP / 2.2.3 Sequences as Conventional Interfaces

Exercise 2.40 · 习题

Exercise 2.40: 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.

练习 2.40:定义一个过程 unique-pairs,给定整数 n,它生成满足 1 ≤ j < i ≤ n 的序对 (i, j) 的序列。利用 unique-pairs 简化上面给出的 prime-sum-pairs 的定义。