s = 0 unseen = 0 seen(v) = bittest(s, v) see(v) = s = bitor(s, 2^v); while (seen(unseen), unseen++) row(n) = { my (r = []); while (n, my (v = valuation(n+n%2, 2)); n \= 2^v; r = concat(v, r)); my (s = [if (#r, 2^r[1]-1, 0)]); for (k = 2, #r, s = concat(s * 2^r[k], [(h+1)*2^r[k]-1|h<-s]);); vecsort(s); } { mx = 2^13; m = -1; for (n=0, oo, if (bitand(n, n\2)==0, r = row(n); for (k=1, #r, if (!seen(r[k]), see(r[k]); print (m++ " " r[k]); ); ); if (unseen==mx, break; ); ); ); } quit