Skip to content

Instantly share code, notes, and snippets.

@imphasing
Created October 18, 2011 16:44
Show Gist options
  • Save imphasing/1295901 to your computer and use it in GitHub Desktop.
Save imphasing/1295901 to your computer and use it in GitHub Desktop.
(define (fib n)
(fib-iter 1 0 n))
(define (fib-iter a b count)
(if (= count 0)
b
(fib-iter (+ a b) a (- count 1))))
(define fibs '())
(let loop ((a 1))
(if (< a 100)
(begin
(set! fibs (append fibs (list (fib a))))
(loop (+ a 1)))))
(filter prime? fibs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment