OFFSET
0,1
EXAMPLE
n 2^n a(n) 2^a(n)
0 1 4 _1_6
1 2 5 3_2_
2 4 6 6_4_
3 8 7 12_8_
4 16 14 _16_384
5 32 15 _32_768
6 64 26 671088_64_
7 128 102 50706024009129176059868_128_21504
8 256 103 101412048018258352119736_256_43008
9 512 104 202824096036516704239472_512_86016
10 1024 224 2695994666715 ... 06736371444225405724811036_1024_9216
11 2048 103 10141_2048_01825835211973625643008
12 4096 104 20282_4096_03651670423947251286016
13 8192 105 40564_8192_07303340847894502572032
MAPLE
a:= proc(n) local k, p; p:= ""||(2^n); for k
from n+1 while searchtext(p, ""||(2^k))=0 do od; k
end:
seq(a(n), n=0..24); # Alois P. Heinz, Mar 17 2021
PROG
(Python)
def a(n):
k, twok, target = n+1, 2**(n+1), str(2**n)
while target not in str(twok): k, twok = k+1, twok*2
return k
print([a(n) for n in range(27)]) # Michael S. Branicky, Mar 16 2021
(PARI) vecmatch(vshort, vlong)={my(l=#vshort, L=#vlong); for(i=0, L-l, if(vshort==vlong[i+1..i+l], return(i+1))); 0}
for(n=0, 26, my(vx=digits(2^n)); for(y=n+1, oo, my(vy=digits(2^y)); if(vecmatch(vx, vy)>0, print1(y, ", "); break)))
(PARI) a(n) = my(k=n+1, s=Str(2^n)); while (#strsplit(Str(2^k), s) <=1, k++); k; \\ Michel Marcus, Mar 17 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hugo Pfoertner, Mar 16 2021
EXTENSIONS
a(28)-a(36) from Jon E. Schoenfield, confirmed by Michael S. Branicky, Mar 17 2021
a(37)-a(43) from Bert Dobbelaere, Mar 19 2021
STATUS
approved