let N = 4 in Array.scan (fun a _ -> a * 2) 2 [|1..N-1|] |> printf "%A"
Standard input is empty
[|2; 4; 8; 16|]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!