This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A063566 #15 Oct 04 2021 09:25:34 %S A063566 10,4,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 A063566 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 A063566 32,33,12,26,27,8,40,26,10,21,8,19,17,24,8,33,16,9,14 %N A063566 3^a(n) = smallest positive power of 3 having n in its decimal representation. %H A063566 Harvey P. Dale, <a href="/A063566/b063566.txt">Table of n, a(n) for n = 0..1000</a> %e A063566 a(2) = a(7) = a(27) = 3 because 3^3 = 27. %t A063566 a = {}; Do[k = 1; While[ StringPosition[ ToString[3^k], ToString[n] ] == {}, k++ ]; a = Append[a, k], {n, 0, 50} ]; a %t A063566 sp3[n_]:=Module[{idn=IntegerDigits[n],t=1},While[!MemberQ[Partition[ IntegerDigits[ 3^t],Length[idn],1],idn],t++];t]; Array[sp3,60,0] (* _Harvey P. Dale_, Oct 29 2013 *) %o A063566 (Python) %o A063566 def a(n): %o A063566 s, k = str(n), 1 %o A063566 while s not in str(3**k): k += 1 %o A063566 return k %o A063566 print([a(n) for n in range(70)]) # _Michael S. Branicky_, Oct 04 2021 %Y A063566 Essentially the same as A062520. %Y A063566 Cf. A000244. %K A063566 base,nonn %O A063566 0,1 %A A063566 _Robert G. Wilson v_, Aug 10 2001