Created
December 5, 2012 21:54
-
-
Save adilakhter/4219837 to your computer and use it in GitHub Desktop.
Euler Problem 002 (3)
This file contains 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
let eulerProblem2Answer' = | |
(0,1) | |
|> Seq.unfold (fun (f1,f2) -> Some(f2, (f2, f1+f2))) | |
|> Seq.takeWhile(fun x -> x < 4000000) | |
|> Seq.sumBy (fun x -> if (x%2)=0 then x else 0) // using SumBy with a projection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment