seen = [0] { v = 0; for (n = 0, 10 000, print (n " " v); for (w = 0, oo, m = bitand(v, w); if (#seen < 1+w, seen = concat(seen, vector(#seen)); ); if (!bittest(seen[1+w], m), seen[1+w] += 2^m; v = w; break; ); ); ); } quit