4 ms·
F#: let total = Seq.initInfinite ((+) 1) |> Seq.map (fun x -> x*x) |> Seq.take 10 |> Seq.sum Alternatively
by Matthias247 12y ago
F#:
let total = Seq.initInfinite ((+) 1)
|> Seq.map (fun x -> x*x)
|> Seq.take 10
|> Seq.sum
Alternatively one could use [1..System.Int32.MaxValue] to create the initial sequence.