s = Set([]) os = Set([]) see(v) = s = setunion(s, Set([v])); if (#s > 1 000, os = setunion(s, os); s = Set([])) seen(v) = return (setsearch(s, v)>0 || setsearch(os, v)>0) other(a) = \ fordiv (a, d, if (!seen(d) && gcd(a/d,d)==1, return (d))); \ my (m=2); \ while (gcd(m,a)>1 || seen(m*a), m++); \ return (m*a) { a = 1; for (n=1, 10 000, print (n " " a); see(a); a = other(a); ); } quit