login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #24 Jul 20 2024 20:10:47

%S 0,1,51,43,692,314,2354,8555,13326,81784,279272,865356,1727608,

%T 1727602,23157022,63416790

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

%H Popular Computing (Calabasas, CA), <a href="/A094776/a094776.jpg">Two Tables</a>, Vol. 1, (No. 9, Dec 1973), page PC9-16.

%e 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 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 (Python)

%o def A131536(n):

%o s, t, m, k, u = '2'*n, '2'*(n+1), 0, 1, '1'

%o while s not in u or t in u:

%o m += 1

%o k *= 2

%o u = str(k)

%o return m # _Chai Wah Wu_, Jan 28 2020

%Y Cf. A006889, A131535, A259089.

%K more,nonn,base

%O 0,3

%A _Shyam Sunder Gupta_, Aug 26 2007

%E 3 more terms from _Sean A. Irvine_, Jul 19 2010

%E a(14) from _Lars Blomberg_, Jan 24 2013

%E a(15) from _Bert Dobbelaere_, Feb 25 2019

%E a(0) from _Chai Wah Wu_, Jan 28 2020