Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created December 5, 2012 21:54
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/4219837 to your computer and use it in GitHub Desktop.
Save adilakhter/4219837 to your computer and use it in GitHub Desktop.
Euler Problem 002 (3)
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