{ base = 2; width = 13; a = vector(base^width-1); u = 1; for (k = 1, oo, w = #d = digits(k, base); for (w = 1, width, for (i = 1, w, if (d[i], while (i+w-1 > #d, d = concat(d, d); ); c = fromdigits(d[i..i+w-1], base); if (a[c]==0, a[c] = k; ); ); ); ); while (a[u], print (u " " a[u]); if (u++ > #a, break (2); ); ); ); } quit