login
Least power of 3 having exactly n consecutive 7's in its decimal representation.
10

%I #19 Mar 20 2019 17:10:45

%S 3,11,112,184,721,3520,6643,12793,67448,208380,364578,1123485,9549790,

%T 23340555,88637856

%N Least power of 3 having exactly n consecutive 7's in its decimal representation.

%C No more terms < 10^8. - _Bert Dobbelaere_, Mar 20 2019

%F a(1) = A063566(7). - _Michel Marcus_, Aug 05 2014

%e a(2) = 11 because 3^11 = 177147 is the smallest power of 3 to contain a run of two consecutive 7's in its decimal form.

%t a = ""; Do[ a = StringJoin[a, "7"]; b = StringJoin[a, "7"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 10} ]

%o (Python)

%o def A131546(n):

%o ....str7 = '7'*n

%o ....x,exponent = 3,1

%o ....while not str7 in str(x):

%o ........exponent += 1

%o ........x *= 3

%o ....return exponent # _Chai Wah Wu_, Aug 05 2014

%Y Cf. A195269, A131552, A131551, A131550, A131549, A131548, A131547, A131545, A131544.

%K more,nonn,base

%O 1,1

%A _Shyam Sunder Gupta_, Aug 26 2007

%E a(11)-a(13) from _Lars Blomberg_, Feb 02 2013

%E a(14)-a(15) from _Bert Dobbelaere_, Mar 20 2019