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

A063572
Smallest power of 9 having n in its decimal representation.
1
5, 2, 3, 6, 5, 4, 4, 3, 2, 1, 11, 15, 18, 11, 6, 18, 17, 19, 13, 23, 9, 8, 14, 21, 12, 13, 26, 28, 12, 3, 8, 6, 13, 24, 10, 18, 12, 27, 9, 27, 10, 6, 9, 8, 6, 14, 8, 7, 9, 5, 18, 16, 18, 6, 13, 35, 4, 20, 13, 5, 11, 4, 23, 18, 12, 4, 17, 8, 24, 7, 22, 17, 3
OFFSET
0,1
COMMENTS
Variant of A062526. - R. J. Mathar, Dec 15 2008
MATHEMATICA
a = {}; Do[k = 1; While[ StringPosition[ ToString[9^k], ToString[n] ] == {}, k++ ]; a = Append[a, k], {n, 0, 60} ]; a
PROG
(Python)
def a(n):
target, k, pow9 = str(n), 1, 9
while not target in str(pow9): k, pow9 = k+1, pow9*9
return k
print([a(n) for n in range(73)]) # Michael S. Branicky, May 02 2021
CROSSREFS
Sequence in context: A229780 A272031 A090183 * A205294 A372806 A131567
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Aug 10 2001
EXTENSIONS
More terms from Michael S. Branicky, May 02 2021
STATUS
approved