big = 1 000 000 s = 0 S = [] unseen = 1 seen(v) = if (v < big, bittest(s, v), setsearch(S, v)) see(v) = if (v < big, s = bitor(s, 2^v), S = setunion(S, [v])); while (seen(unseen), unseen++) n = 0 a = vector(101) emit(v) = { see(v); print (n++ " " v); if (n <= #a, a[n] = v; ); } { for (v = 1, #a, nb = 0; un = unseen; forstep (c = un, oo, un, if (!seen(c), emit(c); if (nb++ == a[v], break; ); ); ); ); } quit