OFFSET
2,2
COMMENTS
EXAMPLE
154 + missingdigit(154, 10) = 154 + 2+3+6+7+8+9 = 189.
The sequence looks like this in bases 2, 3 and 10:
0 + missingdigit(0,2) = 0 + 1 = 1.
missingdigit(1,2) = 0. (1 step)
0 + missingdigit(0,3) = 0 + (1+2) = 10.
10 + missingdigit(10,3) = 10 + 2 = 12.
missingdigit(12,3) = 0. (2 steps)
0 + missingdigit(0,10) = 0 + 45 = 45.
45 + missingdigit(45) = 45 + 36 = 81.
81 + missingdigit(81) = 81 + 36 = 117.
117 + missingdigit(117) = 117 + 37 = 154.
154 + missingdigit(154) = 154 + 35 = 189.
After 6824303 steps, the sequence reaches 123456978 and stops, because missingdigit(123456978) = 0.
PROG
(PARI) { bmx=12; for(b=2, bmx, n=0; miss=1; c=0; all=b*(b-1)/2; while(miss>0, d=vecsort(digits(n, b), , 8); miss=all-sum(i=1, #d, d[i]); n+=miss; c++; ); print1(c-1, ", "); ); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Anthony Sand, Aug 26 2014
EXTENSIONS
a(13)-a(21) from Hiroaki Yamanouchi, Aug 02 2015
STATUS
approved