p = primes(41) s = [] { k=0; for (n=1, #p, z=vector(n); j=0; t=0; forstep (i=n, 1, -1, z[j++] = t+=p[i]; ); s=setunion(s,z); apply (v -> print (k++ " " v), s); ); } quit