Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created December 5, 2012 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adilakhter/4219827 to your computer and use it in GitHub Desktop.
Save adilakhter/4219827 to your computer and use it in GitHub Desktop.
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