A063572 Smallest power of 9 having n in its decimal representation.
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
Programs
-
Mathematica
a = {}; Do[k = 1; While[ StringPosition[ ToString[9^k], ToString[n] ] == {}, k++ ]; a = Append[a, k], {n, 0, 60} ]; a
-
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
Extensions
More terms from Michael S. Branicky, May 02 2021
Comments