The problem is that all the programs start their search at 1 (except tinhorn2's, which starts at 9). If 1 is composite, then it's a counterexample, because it cannot be expressed as a prime plus twice a square. (In fact, 1 is neither prime nor composite.)
Fortunately, they're all easy to fix. The stream-based programs can use (integers-starting-with 3) instead of integers or (stream-iota); the sequence-based programs can use (in-naturals 3); and the loop program can use (let ((n 3)) ...).
no subject
Date: 2008-03-17 05:37 am (UTC)Fortunately, they're all easy to fix. The stream-based programs can use
(integers-starting-with 3)
instead ofintegers
or(stream-iota)
; the sequence-based programs can use(in-naturals 3)
; and the loop program can use(let ((n 3)) ...)
.