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”).

A062525
8^a(n) is smallest power of 8 containing the string 'n'.
3
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, 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, 13, 16, 25, 11, 11, 20, 25, 6, 27, 2, 14, 24, 8, 5, 20, 23, 7, 8, 10, 10, 13
OFFSET
0,1
LINKS
MAPLE
F:= proc(dmax) local R, count, x, N, L, d, i, v, p;
count:= 0: x:= 1/8: N:= 10^dmax:
for p from 0 while count < N do
x:= 8*x;
L:= convert(x, base, 10);
for d from 1 to min(dmax, nops(L)) do
for i from 1 to nops(L)-d+1 do
v:= add(L[j]*10^(j-i), j=i..i+d-1);
if not assigned(R[v]) then count:= count+1; R[v]:= p fi
od od od;
seq(R[v], v=0..N-1);
end proc:
F(2); # Robert Israel, Dec 25 2019
MATHEMATICA
Table[k = 0; While[ StringPosition[ ToString[8^k], ToString[n] ] == {}, k++ ]; k, {n, 0, 75} ]
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 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Jun 24 2001
STATUS
approved