Skip to content

Instantly share code, notes, and snippets.

@tamurashingo
Created December 4, 2012 16:50
Show Gist options
  • Save tamurashingo/4206096 to your computer and use it in GitHub Desktop.
Save tamurashingo/4206096 to your computer and use it in GitHub Desktop.
(define fib
(lambda (limit)
(letrec ((loop (lambda (a b lst)
(let ((s (+ a b)))
(if (<= limit s)
lst
(loop b s (append lst (list s))))))))
(loop 1 2 (list 1 2)))))
(fib 4000000)
(filter even? (fib 4000000))
(apply + (filter even? (fib 4000000)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment