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

%I #15 Mar 21 2019 07:23:40

%S 4,19,93,334,841,3404,7271,7720,44152,406774,993948,2421339,8786439,

%T 11387707,93548200

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

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

%e a(3)=93 because 3^93 (i.e., 235655016338368235499067731945871638181119123) is the smallest power of 3 to contain a run of 3 consecutive ones in its decimal form.

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

%o (Python)

%o def A131552(n):

%o ....m, s = 1, '1'*n

%o ....for i in range(1,10**9):

%o ........m *= 3

%o ........if s in str(m):

%o ............return i

%o ....return "search limit reached." # _Chai Wah Wu_, Dec 11 2014

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

%K more,nonn,base

%O 1,1

%A _Shyam Sunder Gupta_, Aug 26 2007

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

%E Definition edited by _Chai Wah Wu_, Dec 11 2014

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