Created
October 1, 2012 08:45
-
-
Save mmitou/3810377 to your computer and use it in GitHub Desktop.
project euler 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- フィボナッチ数列の項は前の2つの項の和である。 最初の2項を 1, 2 とすれば、最初の10項は以下の通りである。 | |
| -- 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... | |
| -- 数列の項の値が400万を超えない範囲で、偶数値の項の総和を求めよ。 | |
| fibo = 1:2:(zipWith (+) (tail fibo) fibo) | |
| euler2 = sum . filter even . takeWhile (< 4000000) $ fibo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment