OFFSET
0,1
COMMENTS
This is to 3 as A030001 is to 2.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..10000
EXAMPLE
a(1) = 1 because 3^0 = 1 has "1" as a substring (not a proper substring, though).
a(2) = 27 because 3^3 = 27 has "2" as a substring.
a(10) = 10460353203 because 3^21 = 10460353203 is the smallest power of 3 whose decimal expansion contains "10" (in this case, "10" happens to be the left-hand or initial digits, but that is not generally true).
MATHEMATICA
A176763[n_] := Block[{k = -1}, While[StringFreeQ[IntegerString[3^++k], IntegerString[n]]]; 3^k]; Array[A176763, 50, 0] (* Paolo Xausa, Apr 03 2024 *)
PROG
(Python)
def a(n):
k, strn = 0, str(n)
while strn not in str(3**k): k += 1
return 3**k
print([a(n) for n in range(33)]) # Michael S. Branicky, Apr 03 2024
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Jonathan Vos Post, Apr 25 2010
EXTENSIONS
More terms from Sean A. Irvine and Jon E. Schoenfield, May 05 2010
a(0) prepended by Paolo Xausa, Apr 03 2024
STATUS
approved