cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A131552 #18 Mar 20 2025 14:27:52
%S A131552 4,19,93,334,841,3404,7271,7720,44152,406774,993948,2421339,8786439,
%T A131552 11387707,93548200
%N A131552 Least positive power of 3 having exactly n consecutive 1's in its decimal representation.
%C A131552 No more terms < 10^8. - _Bert Dobbelaere_, Mar 20 2019
%e A131552 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 A131552 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 A131552 (Python)
%o A131552 def A131552(n):
%o A131552     m, s = 1, '1'*n
%o A131552     for i in range(1, 10**9):
%o A131552         m *= 3
%o A131552         if s in str(m):
%o A131552             return i
%o A131552     return "search limit reached." # _Chai Wah Wu_, Dec 11 2014
%Y A131552 Cf. A195269, A131551, A131550, A131549, A131548,  A131547,  A131546, A131545,  A131544.
%K A131552 more,nonn,base
%O A131552 1,1
%A A131552 _Shyam Sunder Gupta_, Aug 26 2007
%E A131552 a(11)-a(14) from _Lars Blomberg_, Feb 02 2013
%E A131552 Definition edited by _Chai Wah Wu_, Dec 11 2014
%E A131552 a(15) from _Bert Dobbelaere_, Mar 20 2019