Skip to content

Instantly share code, notes, and snippets.

@captainsafia
Created August 17, 2012 20:51
Show Gist options
  • Save captainsafia/3382528 to your computer and use it in GitHub Desktop.
Save captainsafia/3382528 to your computer and use it in GitHub Desktop.
Solution to Project Euler Problem 1 in Scheme
(define sum 0)
(define (3or5 start limit inc)
(if (< start limit)
(begin
(if (= (remainder start 3) 0) (set! sum (+ sum start)) (if (= (remainder start 5) 0) (set! sum (+ sum start))))
(3or5 (+ start inc) limit inc))) sum)
(print (3or5 0 1000 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment