OFFSET
0,3
COMMENTS
If 9 appears anywhere in the decimal expansion of 2*a(n-1), we replace that digit with 10 upon incrementing by 1. See a(12) of the Examples section and A216556 for more information.
FORMULA
a(n) = A216556(2*a(n-1)), a(0) = 0.
EXAMPLE
To calculate a(12), double 55897 to get 111794, then increment the digits by 1 to get 2228105.
To calculate a(13), double 2228105 to get 4456210, then increment the digits by 1 to get 5567321.
MAPLE
a:= proc(n) option remember; `if`(n=0, 0, (l-> parse(cat(seq(
l[-i]+1, i=1..nops(l)))))(convert(2*a(n-1), base, 10)))
end:
seq(a(n), n=0..25); # Alois P. Heinz, Dec 12 2020
MATHEMATICA
NestList[FromDigits[Flatten@ Map[IntegerDigits, IntegerDigits[2 #] + 1]] &, 0, 24] (* Michael De Vlieger, Dec 11 2020 *)
PROG
(PARI) digs(n) = if (n==0, [0], digits(n));
lista(nn) = {a = 0; print1(a, ", "); for (n=1, nn, a = eval(concat(apply(t->Str(t+1), digs(2*a)))); print1(a, ", "); ); } \\ Michel Marcus, Nov 28 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Jamie Robert Creasey, Nov 21 2020
STATUS
approved