s = 0 unseen = 1 seen(v) = bit test(s, v) see(v) = s = bit or(s, 2^v); while (seen(unseen), unseen++) x = 1 other() = { for (v=unseen, oo, if (!seen(v), if (gcd(x,v)==1, x*=v; see(v); return (v), x%v==0, x/=v; see(v); return (v); ); ); ); } for (n=1, 10 000, print (n " " other())) quit