big = 1 000 000 s = 0 S = Set([]) unseen = 1 seen(v) = if (v < big, bit test(s, v), set search(S, v)) see(v) = if (v < big, s = bit or(s, 2^v), S = set union(S, Set([v]))); while (seen(unseen), unseen++) mx = 1679616000000 vv = [0] nb = 0 explore(v) = { if (v<=mx && !seen(v), see(v); if (#vv print (n++ " " v), Set(vv[1..nb])) quit