login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062520 3^a(n) is smallest nonnegative power of 3 containing the string 'n'. 2

%I

%S 10,0,3,1,5,8,8,3,4,2,21,19,17,22,11,13,17,11,7,9,18,7,19,13,5,26,19,

%T 3,24,6,16,12,13,31,15,21,24,29,18,31,17,12,18,5,12,28,16,11,15,10,35,

%U 32,33,12,26,27,8,40,26,10,21,8,19,17,24,8,33,16,9,14,35,11,6,29,18,47

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

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

%p N:= 99:

%p count:= 1: A["0"]:= 10:

%p for n from 0 while count <= N do

%p S:= convert(3^n,string); nS:= length(S);

%p for m from 1 to 2 while count <= N do

%p for i from 1 to nS+1-m while count <= N do

%p if S[i] <> "0" and not assigned(A[S[i..i+m-1]]) then

%p count:= count+1; A[S[i..i+m-1]]:= n;

%p fi

%p od

%p od

%p od:

%p seq(A[convert(n,string)],n=0..N); # _Robert Israel_, Jun 14 2018

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

%Y Cf. A030000. Essentially the same as A063566.

%K base,nonn

%O 0,1

%A _Robert G. Wilson v_, Jun 24 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 8 08:08 EDT 2020. Contains 335520 sequences. (Running on oeis4.)