summaryrefslogtreecommitdiff
path: root/euler2.scm
blob: f47cad23d4c2e05785399bcc23619c24a83e981c (plain)
1
2
3
4
5
6
7
8
9
10
(define (sum-fib sum a b c)
 (if (> a 4000000)
  sum
  (if (even? a)
   (sum-fib (+ sum a) b c (+ b c))
   (sum-fib sum b c (+ b c)))))

(display (sum-fib 0 1 2 3))
(newline)