Euler Problem 002 (2)
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))) // Fibonacci Sequence | |
|> Seq.takeWhile(fun x -> x < 4000000) // Taking upto Max Fibbonacci | |
|> Seq.filter (fun x -> x%2=0) // Filtering only even numbers | |
|> Seq.sum // computing sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment