I’m not certain a vector is possible, but a matrix approach could be.
Consider the rows of ‘out’:
N = 5;
L = 10;
out = hankel(1:N, N:L);
out(2:end,:) = cumsum(out(2:end,:),2);
I used the example with a short vector to illustrate the approach. Experiment to get the result you want.