Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sum of even terms in Fibonacci sequence which are < four-million:
(1, 1) |> Seq.unfold (fun (a, b) -> Some(a, (b, a + b))) // fibs
|> Seq.takeWhile (fun x -> x <= 4000000)
|> Seq.filter (fun x -> x % 2 = 0)
|> Seq.sum
I like how Fibonacci can be represented as a single unfold.