login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

8^a(n) is smallest power of 8 containing the string 'n'.
3

%I #8 Dec 25 2019 23:11:41

%S 4,0,3,5,2,3,2,5,1,4,10,14,3,9,6,7,8,9,10,12,7,6,17,21,10,17,6,5,9,20,

%T 26,25,5,21,9,15,12,10,13,14,4,10,9,14,6,11,14,12,17,13,18,3,7,29,13,

%U 13,16,25,11,11,20,25,6,27,2,14,24,8,5,20,23,7,8,10,10,13

%N 8^a(n) is smallest power of 8 containing the string 'n'.

%H Robert Israel, <a href="/A062525/b062525.txt">Table of n, a(n) for n = 0..9999</a>

%p F:= proc(dmax) local R,count,x,N,L,d,i,v, p;

%p count:= 0: x:= 1/8: N:= 10^dmax:

%p for p from 0 while count < N do

%p x:= 8*x;

%p L:= convert(x,base,10);

%p for d from 1 to min(dmax, nops(L)) do

%p for i from 1 to nops(L)-d+1 do

%p v:= add(L[j]*10^(j-i),j=i..i+d-1);

%p if not assigned(R[v]) then count:= count+1; R[v]:= p fi

%p od od od;

%p seq(R[v],v=0..N-1);

%p end proc:

%p F(2); # _Robert Israel_, Dec 25 2019

%t Table[k = 0; While[ StringPosition[ ToString[8^k], ToString[n] ] == {}, k++ ]; k, {n, 0, 75} ]

%t Join[{4,0},With[{c=Table[{n,IntegerDigits[8^n]},{n,50}]},Table[ SelectFirst[ c,SequenceCount[ #[[2]],IntegerDigits[k]]>0&],{k,2,80}]][[All,1]]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Apr 13 2019 *)

%Y Cf. A030000, A063571, A176768.

%K base,nonn

%O 0,1

%A _Robert G. Wilson v_, Jun 24 2001