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.

A131536 Exponent of least power of 2 having exactly n consecutive 2's in its decimal representation.

This page as a plain text file.
%I A131536 #24 Jul 20 2024 20:10:47
%S A131536 0,1,51,43,692,314,2354,8555,13326,81784,279272,865356,1727608,
%T A131536 1727602,23157022,63416790
%N A131536 Exponent of least power of 2 having exactly n consecutive 2's in its decimal representation.
%H A131536 Popular Computing (Calabasas, CA), <a href="/A094776/a094776.jpg">Two Tables</a>, Vol. 1, (No. 9, Dec 1973), page PC9-16.
%e A131536 a(3)=43 because 2^43(i.e. 8796093022208) is the smallest power of 2 to contain a run of 3 consecutive twos in its decimal form.
%t A131536 a = ""; Do[ a = StringJoin[a, "2"]; b = StringJoin[a, "2"]; k = 1; While[ StringPosition[ ToString[2^k], a] == {} || StringPosition[ ToString[2^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
%o A131536 (Python)
%o A131536 def A131536(n):
%o A131536     s, t, m, k, u = '2'*n, '2'*(n+1), 0, 1, '1'
%o A131536     while s not in u or t in u:
%o A131536         m += 1
%o A131536         k *= 2
%o A131536         u = str(k)
%o A131536     return m # _Chai Wah Wu_, Jan 28 2020
%Y A131536 Cf. A006889, A131535, A259089.
%K A131536 more,nonn,base
%O A131536 0,3
%A A131536 _Shyam Sunder Gupta_, Aug 26 2007
%E A131536 3 more terms from _Sean A. Irvine_, Jul 19 2010
%E A131536 a(14) from _Lars Blomberg_, Jan 24 2013
%E A131536 a(15) from _Bert Dobbelaere_, Feb 25 2019
%E A131536 a(0) from _Chai Wah Wu_, Jan 28 2020