# Project Euler Problem 25

Project Euler Problem 25 allows to compose the solution of pieces done earlier: reusing the code from Project Euler Problem 2 solution adopted for infinite Fibonacci sequence makes the code succinct:

let inline nDigits n = String.length <| (n.ToString()) let fibnums = Seq.unfold (fun (current, next) -> Some(current, (next, current+next)))(0I,1I) let problem025 () = fibnums |> Seq.takeWhile (fun x -> nDigits x < 1000) |> Seq.length

Advertisements

Leave a Comment