Project Euler 2

Project Euler Problem 2

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

Find the sum of all the even-valued terms in the sequence which do not exceed four million.

term→項(数学)
generated by→〜によって発生する
even-valued→偶数
exceed→超えている


フィボナッチ数列では、それぞれ新しい項は前の2つの項を加えることによって発生している。
1と2で始まったら、最初の10個の項は、1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
400万を超えていないフィボナッチ数列の中で偶数項の和を探せ!


Emacsschemeは一旦保留して、Dr.schemeで!ひとまずフィボナッチの復習

(define (fibo n)

    (cond

       ((= n 0) 0)

       ((= n 1) 1)

       (else (+ (fibo (- n 1)) (fibo (- n 2))))
)) 

復習するのにここが凄く良かったっス!
Handbook Prog Scheme言語
独習 Scheme 三週間

作成中

気になってた本のサイトも発見すた
How to Design Programs