Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created December 5, 2012 21:52
Embed
What would you like to do?
Euler Problem 002 (2)
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