{ total = 0; all = 0; \\ when bit k is set, then all multiples of k up to the current total \\ have appeared earlier as intermediate totals for (n=1, 10 000, if (total, fordiv (total, d, if (bittest(all, total/d), v = d; ); ), v=1 ); print (n " " v); for (x=total+1, total+v-1, fordiv (x, t, if (bittest(all, t), \\ a multiple of t is missing as intermediate total all -= 2^t; ); ); ); all += 2^(total += v); ); } quit