lim = 25 000 seen = 0 unseen = 1 see(v) = if (v < lim && !bittest(seen, v), seen += 2^v; while (bittest(seen, unseen), unseen++); if (unseen==lim, quit)) combine(x,y) = x * 10^#digits(y) + y { a = vector(10 000); for (n=1, #a, print (n " " a[n] = unseen); see(a[n]); for (k=1, n-1, see(combine(a[k], a[n])); see(combine(a[n], a[k])); ); ); } quit