\\ /!\ The program will display the first values in a few minutes! base = 10 a = vector(10 000) explore(v, m) = { if (v, fordiv (v, d, if (d>#a, break, a[d]=max(a[d], v)); ); ); v *= base; for (d=if (v, 0, 1), base-1, if (bittest(m, d), explore(v+d, m-2^d); ); ); } explore(0, -1); for (n=1, #a, print (n " " a[n]/n)) quit