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