結果 : sum of first n elements of array python