Skip to content

Instantly share code, notes, and snippets.

@ssboisen
Created February 6, 2012 08:27
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 ssboisen/1750727 to your computer and use it in GitHub Desktop.
Save ssboisen/1750727 to your computer and use it in GitHub Desktop.
let fibs = Seq.unfold( fun (a,b) -> Some( a + b, (b, a + b) ) ) (1,1)
let result = fibs |> Seq.takeWhile ( fun x -> x <= 4000000)
|> Seq.sumBy ( fun x -> if x % 2 = 0 then x else 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment