%I #7 Nov 14 2019 14:36:34
%S 4,4,4,3,2,7,5,1,5,2,13,6,12,12,19,15,5,6,19,11,12,22,14,7,4,30,11,23,
%T 10,16,14,19,11,16,3,7,9,19,12,17,4,12,27,3,18,21,32,10,8,2,15,17,10,
%U 9,7,21,15,8,21,18,9
%N Smallest positive power of 7 having n in its decimal representation.
%H Chai Wah Wu, <a href="/A063570/b063570.txt">Table of n, a(n) for n = 0..10000</a>
%t a = {}; Do[k = 1; While[ StringPosition[ ToString[7^k], ToString[n] ] == {}, k++ ]; a = Append[a, k], {n, 0, 60} ]; a
%o (Python)
%o def A063570(n):
%o m, k, s = 1, 7, str(n)
%o while s not in str(k):
%o m += 1
%o k *= 7
%o return m # _Chai Wah Wu_, Nov 14 2019
%Y Essentially the same as A062524.
%K base,nonn
%O 0,1
%A _Robert G. Wilson v_, Aug 10 2001
|