%I #35 Dec 21 2020 18:11:04
%S 0,1,3,7,25,61,233,577,2265,5641,22393,55897,2228105,5567321,22245753,
%T 555102617,2221316345,55537437101,222185985313,5554821081737,
%U 222110753274585,5553326176510281,22217763464131673,555466371039374457,222110438531898591025
%N a(0) = 0. Successive terms are double the previous, then with their digits incremented by 1.
%C 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.
%F a(n) = A216556(2*a(n-1)), a(0) = 0.
%e To calculate a(12), double 55897 to get 111794, then increment the digits by 1 to get 2228105.
%e To calculate a(13), double 2228105 to get 4456210, then increment the digits by 1 to get 5567321.
%p a:= proc(n) option remember; `if`(n=0, 0, (l-> parse(cat(seq(
%p l[-i]+1, i=1..nops(l)))))(convert(2*a(n-1), base, 10)))
%p end:
%p seq(a(n), n=0..25); # _Alois P. Heinz_, Dec 12 2020
%t NestList[FromDigits[Flatten@ Map[IntegerDigits, IntegerDigits[2 #] + 1]] &, 0, 24] (* _Michael De Vlieger_, Dec 11 2020 *)
%o (PARI) digs(n) = if (n==0, [0], digits(n));
%o 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
%Y Cf. A000079, A061511, A089718.
%K base,nonn
%O 0,3
%A _Jamie Robert Creasey_, Nov 21 2020
|