{ a = vector(M=1 000); \\ A297359 flattened a[1] = a[2] = 1; \\ seed t = []; \\ current diagonal for (d=1, M, tt = t; t = vector(d); for (k=1, d, t[k] = if (k==1 || k==d, a[d], tt[k-1]+tt[k]); if (m++<=#a, a[m] = t[k]; ); ); print (d " " vecsum(t)); ); } quit