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.

Showing 1-9 of 9 results.

A006889 Exponent of least power of 2 having n consecutive 0's in its decimal representation.

Original entry on oeis.org

0, 10, 53, 242, 377, 1491, 1492, 6801, 14007, 100823, 559940, 1148303, 4036338, 4036339, 53619497, 119476156, 146226201, 918583174, 4627233991, 11089076233
Offset: 0

Views

Author

P. D. Mitchelmore (dh115(AT)city.ac.uk)

Keywords

Comments

A224782(a(n)) = n and A224782(m) <> n for m < a(n). - Reinhard Zumkeller, Apr 30 2013
The name of this sequence previously began "Least power of 2 having exactly n consecutive 0's...". The word "exactly" was unnecessary because the least power of 2 having at least n consecutive 0's in its decimal representation will always have exactly n consecutive 0's. The previous power of two will have had n-1 consecutive 0's with a "5" immediately to the left. - Clive Tooth, Jan 22 2016
a(20) is greater than 12*10^9. - Benjamin Chaffin, Jan 18 2017

Examples

			2^53619497 is the smallest power of 2 to contain a run of 14 consecutive zeros in its decimal form.
2^119476156 (a 35965907-digit number) contains the sequence ...40030000000000000008341... about one third of the way through.
2^4627233991 (a 1392936229-digit number) contains the sequence "813000000000000000000538" about 99.5% of the way through. The computation took about six months.
		

References

  • Julian Havil, Impossible?: Surprising Solutions to Counterintuitive Conundrums, Princeton University Press 2008, chapter 15, p. 176ff
  • Popular Computing (Calabasas, CA), Zeros in Powers of 2, Vol. 3 (No. 25, Apr 1975), page PC25-16 [Gives a(1)-a(8)]
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a006889 = fromJust . (`elemIndex` a224782_list)
    -- Reinhard Zumkeller, Apr 30 2013
    
  • Maple
    A[0]:= 0:
    m:= 1:
    for n from 1 while m <= 9 do
      S:= convert(2^n,string);
      if StringTools:-Search(StringTools:-Fill("0",m),S) <> 0 then
        A[m]:= n;
        m:= m+1;
      fi
    od:
    seq(A[i],i=0..9); # Robert Israel, Jan 22 2016
  • Mathematica
    a = ""; Do[ a = StringJoin[a, "0"]; k = 1; While[ StringPosition[ ToString[2^k], a] == {}, k++ ]; Print[k], {n, 1, 10} ] (* Robert G. Wilson v, edited by Clive Tooth, Jan 25 2016 *)
  • PARI
    conseczerorec(n) = my(d=digits(n), i=0, r=0, x=#Str(n)); while(x > 0, while(d[x]==0, i++; x--); if(i > r, r=i); i=0; x--); r
    a(n) = my(k=0); while(conseczerorec(2^k) < n, k++); k \\ Felix Fröhlich, Sep 27 2016

Extensions

3 more terms from Clive Tooth, Jan 24 2001
One more term from Clive Tooth, Nov 28 2001
One more term from Sacha Roscoe (scarletmanuka(AT)iprimus.com.au), Dec 16 2002
a(17) from Sacha Roscoe (scarletmanuka(AT)iprimus.com.au), Feb 06 2007
a(18) from Clive Tooth, Sep 30 2012
Name clarified by Clive Tooth, Jan 22 2016
Definition clarified by Felix Fröhlich, Sep 27 2016
a(19) from Benjamin Chaffin, Jan 18 2017

A063565 Smallest positive number k such that 2^k contains n.

Original entry on oeis.org

10, 4, 1, 5, 2, 8, 4, 15, 3, 12, 10, 40, 7, 17, 18, 21, 4, 27, 30, 13, 11, 18, 43, 41, 10, 8, 18, 15, 7, 32, 22, 17, 5, 25, 27, 25, 16, 30, 14, 42, 12, 22, 19, 22, 18, 28, 42, 31, 11, 32, 52, 9, 19, 16, 25, 16, 8, 20, 33, 33, 23, 58, 18, 14, 6, 16, 46, 24, 15, 34, 29, 21, 17, 30
Offset: 0

Views

Author

Robert G. Wilson v, Aug 10 2001

Keywords

Examples

			a(7) = 15 because 2^15 = 32768.
		

Crossrefs

Apart from initial term, a duplicate of A030000.

Programs

  • Mathematica
    a = {}; Do[k = 1; While[ StringPosition[ ToString[2^k], ToString[n] ] == {}, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
  • Python
    def A063565(n):
        s, k, k2 = str(n), 1, 2
        while True:
            if s in str(k2):
                return k
            k += 1
            k2 *= 2 # Chai Wah Wu, Jun 20 2015

Extensions

More terms from Hans Havermann

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

Original entry on oeis.org

0, 1, 51, 43, 692, 314, 2354, 8555, 13326, 81784, 279272, 865356, 1727608, 1727602, 23157022, 63416790
Offset: 0

Views

Author

Shyam Sunder Gupta, Aug 26 2007

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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} ]
  • Python
    def A131536(n):
        s, t, m, k, u = '2'*n, '2'*(n+1), 0, 1, '1'
        while s not in u or t in u:
            m += 1
            k *= 2
            u = str(k)
        return m # Chai Wah Wu, Jan 28 2020

Extensions

3 more terms from Sean A. Irvine, Jul 19 2010
a(14) from Lars Blomberg, Jan 24 2013
a(15) from Bert Dobbelaere, Feb 25 2019
a(0) from Chai Wah Wu, Jan 28 2020

A171252 Least power of 2 to have at least n consecutive digits 'n' in its decimal expansion.

Original entry on oeis.org

0, 0, 43, 83, 192, 973, 2269, 972, 25263, 42485
Offset: 0

Views

Author

M. F. Hasler, Dec 06 2009

Keywords

Comments

As it stands, the definition makes only sense for (decimal digits) n=0,...,9. Replacing "decimal" by, e.g., base-(prime(n)), the sequence could be defined for all n. (However, e.g., base-(n+1) would not work, since in base 4 no power of 2 has a digit "3".)

Crossrefs

Programs

  • PARI
    A171252(n)={my(p=10^n, t); n*=p\9; for(k=0,1e9, t=2^k; until( n>t\=10, t%p==n & return(k)))}
    for(d=0,9, print(d" "A171252(d)))

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

Original entry on oeis.org

0, 1, 43, 43, 314, 314, 2354, 8555, 13326, 81784, 279272, 865356, 1727602, 1727602
Offset: 0

Views

Author

N. J. A. Sloane, Jun 18 2015

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; While[! SequenceCount[IntegerDigits[2^k], ConstantArray[2, n]] > 0, k++]; k, {n, 10}] (* Robert Price, May 17 2019 *)
  • Python
    def A259089(n):
        s, k, k2 = '2'*n, 0, 1
        while True:
            if s in str(k2):
                return k
            k += 1
            k2 *= 2 # Chai Wah Wu, Jun 19 2015

Extensions

a(7)-a(13) from Chai Wah Wu, Jun 20 2015
Definition corrected by Manfred Scheucher, Jun 23 2015
a(0) prepended by Chai Wah Wu, Jan 28 2020

A259091 Smallest k such that 2^k contains two adjacent copies of n in its decimal expansion.

Original entry on oeis.org

53, 40, 43, 25, 18, 16, 46, 24, 19, 33, 378, 313, 170, 374, 361, 359, 64, 34, 507, 151, 348, 246, 314, 284, 349, 314, 261, 151, 385, 166, 156, 364, 65, 219, 371, 359, 503, 148, 155, 352, 349, 308, 247, 255, 192, 387, 165, 149, 171, 150, 210, 155, 209, 101, 505
Offset: 0

Views

Author

N. J. A. Sloane, Jun 18 2015

Keywords

Comments

The multi-digit generalization of A171132. - R. J. Mathar, Jul 06 2015

Examples

			2^53 = 9007199254740992 contains two adjacent 0's.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; While[! SequenceCount[IntegerDigits[2^k], Flatten[ConstantArray[IntegerDigits[n], 2]]] > 0, k++]; k, {n, 0, 100}] (* Robert Price, May 17 2019 *)
  • Python
    def A259091(n):
        s, k, k2 = str(n)*2, 0, 1
        while True:
            if s in str(k2):
                return k
            k += 1
            k2 *= 2 # Chai Wah Wu, Jun 18 2015

Extensions

More terms from Chai Wah Wu, Jun 18 2015

A259092 Smallest k such that 2^k contains three adjacent copies of n in its decimal expansion.

Original entry on oeis.org

242, 42, 43, 83, 44, 41, 157, 24, 39, 50, 949, 1841, 3661, 1798, 1701, 1161, 1806, 391, 1890, 2053, 950, 1164, 2354, 1807, 3816, 1800, 1799, 818, 1702, 2115, 904, 1798, 1807, 2270, 392, 1699, 3022, 394, 2054, 1758, 1804, 2300, 2720, 2403, 3396, 1133, 1808, 3820
Offset: 0

Views

Author

N. J. A. Sloane, Jun 18 2015

Keywords

Comments

The multi-digit generalization of A171242. - R. J. Mathar, Jul 06 2015

Examples

			2^242 = 7067388259113537318333190002971674063309935587502475832486424805170479104 contains three adjacent 0's.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 0; While[! SequenceCount[IntegerDigits[2^k], Flatten[ConstantArray[IntegerDigits[n], 3]]] > 0, k++]; k, {n, 0, 50}] (* Robert Price, May 17 2019 *)
  • Python
    def A259092(n):
        s, k, k2 = str(n)*3, 0, 1
        while True:
            if s in str(k2):
                return k
            k += 1
            k2 *= 2 # Chai Wah Wu, Jun 18 2015

Extensions

More terms from Chai Wah Wu, Jun 18 2015

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

Original entry on oeis.org

0, 4, 46, 157, 222, 220, 2269, 11019, 18842, 192918, 192916, 271979, 1039316, 7193133, 14060686, 97428976
Offset: 0

Views

Author

Shyam Sunder Gupta, Aug 26 2007

Keywords

Examples

			a(3)=157 because 2^157(i.e. 182687704666362864775460604089535377456991567872) is the smallest power of 2 to contain a run of 3 consecutive sixes in its decimal form.
		

Crossrefs

Programs

  • Mathematica
    a = ""; Do[ a = StringJoin[a, "6"]; b = StringJoin[a, "6"]; k = 1; While[ StringPosition[ ToString[2^k], a] == {} || StringPosition[ ToString[2^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]

Extensions

Two more terms from Sean A. Irvine, May 31 2010
a(13)-a(14) from Lars Blomberg, Jan 24 2013
a(15) from Bert Dobbelaere, Mar 07 2019
a(0)=0 prepended by Paul Geneau de Lamarlière, Jul 20 2024

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

Original entry on oeis.org

0, 15, 27, 24, 181, 317, 2309, 972, 25264, 131979, 279275, 279269, 1727605, 6030752, 8760853, 77235364
Offset: 0

Views

Author

Shyam Sunder Gupta, Aug 26 2007

Keywords

Examples

			a(3)=24 because 2^24(i.e. 16777216) is the smallest power of 2 to contain a run of 3 consecutive sevens in its decimal form.
		

Crossrefs

Programs

  • Mathematica
    a = ""; Do[ a = StringJoin[a, "7"]; b = StringJoin[a, "7"]; k = 1; While[ StringPosition[ ToString[2^k], a] == {} || StringPosition[ ToString[2^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]

Extensions

a(11)-a(12) from Sean A. Irvine, May 31 2010
a(13)-a(14) from Lars Blomberg, Jan 24 2013
a(15) from Bert Dobbelaere, Mar 02 2019
a(0)=0 prepended by Paul Geneau de Lamarlière, Jul 20 2024
Showing 1-9 of 9 results.