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++) w(n) = my (f=factor(n)); sum (i=1, #f~, hamming weight(f[i,2])) W = 5 other(p) = { see(p); for (v=unseen, oo, if (!seen(v) && w(p*v) >= W, return (v); ); ); } v=1; for (n=1, 10 000, print (n " " v); v=other(v)) quit