LOOP SEQUENCE NUMBERS IN MAXSCRIPT

I have an array x = #(1,2,3...,n) . How can i create an array y :

y = x
y = x + x
y = x + x + x
.................
y[n] = x + x + x + .... +x[n]

Can you give me the funtion ? Thank you for your help

Comment viewing options here..suppose it easy to make the fn yourself...

eArr=#()
arr = #(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
for i=1 to arr.count do
(
local temp=#()
local txt= "y"+"["+(i as string)+"]="

if i == 1 then
(
txt+="x"+"["+(i as string)+"]"
)
else
(
for y=1 to i  do
(
txt+="x"+"["+(y as string)+"]"
if y==i do continue
txt+="+"
)
)

append temp #(txt)
join eArr temp
)

eArr

--#(#("y=x"), #("y=x+x"), #("y=x+x+x"), #("y=x+x+x+x"), #("y=x+x+x+x+x"), #("y=x+x+x+x+x+x"), #("y=x+x+x+x+x+x+x"), #("y=x+x+x+x+x+x+x+x"), #("y=x+x+x+x+x+x+x+x+x"), #("y=x+x+x+x+x+x+x+x+x+x"))

thats the formula... you could convert it to array of number (result) too with little tweak `

here u go

fn NewArr a b:#() = (
for i = 1 to a.count do (
b[i] = 0
b[i] = for j = 1 to i collect b[i] += a[j]
)
b
)

a = #(1,2,3,4,5)
b = NewArr a

print b