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.

A259089 Least k such that 2^k has at least n consecutive 2's in its decimal representation.

This page as a plain text file.
%I A259089 #31 Sep 30 2024 18:40:39
%S A259089 0,1,43,43,314,314,2354,8555,13326,81784,279272,865356,1727602,1727602
%N A259089 Least k such that 2^k has at least n consecutive 2's in its decimal representation.
%H A259089 Popular Computing (Calabasas, CA), <a href="/A094776/a094776.jpg">Two Tables</a>, Vol. 1, (No. 9, Dec 1973), page PC9-16.
%e A259089 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 A259089 Table[k = 0; While[! SequenceCount[IntegerDigits[2^k], ConstantArray[2, n]] > 0, k++]; k, {n, 10}] (* _Robert Price_, May 17 2019 *)
%o A259089 (Python)
%o A259089 def A259089(n):
%o A259089     s, k, k2 = '2'*n, 0, 1
%o A259089     while True:
%o A259089         if s in str(k2):
%o A259089             return k
%o A259089         k += 1
%o A259089         k2 *= 2 # _Chai Wah Wu_, Jun 19 2015
%Y A259089 Cf. A006889, A131535, A131536, A063565, A259091, A259092.
%K A259089 more,nonn,base
%O A259089 0,3
%A A259089 _N. J. A. Sloane_, Jun 18 2015
%E A259089 a(7)-a(13) from _Chai Wah Wu_, Jun 20 2015
%E A259089 Definition corrected by _Manfred Scheucher_, Jun 23 2015
%E A259089 a(0) prepended by _Chai Wah Wu_, Jan 28 2020