Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tetsu-miyagawa/ed17f33f7f0db27906c2 to your computer and use it in GitHub Desktop.
Save tetsu-miyagawa/ed17f33f7f0db27906c2 to your computer and use it in GitHub Desktop.
SICP Exercise 1.22 odd-sequence
(define (odd-sequence min max)
(cond ((even? min) (odd-sequence (+ 1 min) max))
((> min max) '())
(else (cons min (odd-sequence (+ 2 min) max)))))
(define (search-for-primes min max)
(map timed-prime-test (odd-sequence min max))
(newline))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment