The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A259089 Least k such that 2^k has at least n consecutive 2's in its decimal representation. 7

%I #27 Jan 28 2020 12:38:01

%S 0,1,43,43,314,314,2354,8555,13326,81784,279272,865356,1727602,1727602

%N Least k such that 2^k has at least 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 Table[k = 0; While[! SequenceCount[IntegerDigits[2^k], ConstantArray[2, n]] > 0, k++]; k, {n, 10}] (* _Robert Price_, May 17 2019 *)

%o (Python)

%o def A259089(n):

%o ....s, k, k2 = '2'*n, 0, 1

%o ....while True:

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

%o ............return k

%o ........k += 1

%o ........k2 *= 2 # _Chai Wah Wu_, Jun 19 2015

%Y Cf. A006889, A131535, A131536, A063565, A259091, A259092.

%K more,nonn,base

%O 0,3

%A _N. J. A. Sloane_, Jun 18 2015

%E a(7)-a(13) from _Chai Wah Wu_, Jun 20 2015

%E Definition corrected by _Manfred Scheucher_, Jun 23 2015

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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 12:41 EDT 2024. Contains 372763 sequences. (Running on oeis4.)