Created
February 6, 2012 08:22
-
-
Save ssboisen/1750709 to your computer and use it in GitHub Desktop.
Project Euler Problems
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
{1..999} |> Seq.sumBy (fun n -> if n % 3 = 0 || n % 5 = 0 then n else 0) |
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 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