let init n f = if n = 0 then [||] else begin let a = Array.make n (f 0) in for i = 1 to n-1 do a.(i) <- f i done; a end;;