mx = 10 000 grow(t) = { my (tt=vector(min(mx, vecsum(t))), u=vector(ceil(vecmax(t)/2)), m=0); for (n=1, #t, for (k=1, t[n], my (d = min(k, t[n]+1-k)); tt[m++] = 2*u[d]++; if (m==mx, break (2); ); ); ); tt } t=[2] while (#t < mx, t=grow(t)) for (n=1, mx, print (n " " t[n])) quit