OFFSET
1,1
MATHEMATICA
b = 10; s = {{2}};
Do[NestWhile[# + 1 &, 0, ! (PrimeQ[FromDigits[tmp = Join[Last[s], (nn = #;
IntegerDigits[nn - Sum[b^n, {n, l = NestWhile[# + 1 &, 1, ! (nn - (Sum[b^n, {n, #}]) < 0) &] - 1}], b, l + 1])], b]]) &]; AppendTo[s, tmp], {20}]; Map[FromDigits, s] (* Peter J. C. Moses, Aug 06 2015 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, May 15 1999
STATUS
approved