allocate mem(2^30) 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++) find(c) = { my (f=factor(c)); if (numdiv(f) < 2^16, fordiv (f, d, if (!seen(d), see(d); return (d); ) ), for (v=unseen, oo, if (c%v==0 && !seen(v), see(v); return (v); ) ) ); } for (n=1, 10 000, print (n " " find(fibonacci(n+1)))) quit