s = 0 seen(v) = bittest(s, v) see(v) = s = bitor(s, 2^v) n = 0 k = 0 b = vector(2^13) \\ binary length stop = 0 emit(v) = { if (n++ <= #b, b[n] = #binary(v), stop = 1 ); if (!seen(v), see(v); print (k++ " " v); ); } { emit(1); while (!stop, apply (emit, Vec(vecsort(b[1..n],, 1))); ); } quit