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-3 of 3 results.

A378472 Position of start of first run of exactly n zeros in the base-2 representation of Pi, or -1 if no such run exists.

Original entry on oeis.org

17, 1, 26, 7, 109, 135, 96, 189, 2610, 902, 4267, 36139, 17317, 8375, 479166, 11791, 112954, 436893, 1286743, 726844, 5572140, 27456324, 2005750, 42248747, 200643872, 547151636, 171498580, 469458286, 1222711767, 2151391703, 1407238214
Offset: 1

Views

Author

James S. DeArmon, Nov 27 2024

Keywords

Comments

In base-2, Pi is: 11.00100100001111110110101010001... For this sequence, the integer part of Pi is ignored, and the first fractional bit is numbered one.
No further terms <= 4*10^9. - Michael S. Branicky, Dec 04 2024

Examples

			The first run of a single "0" bit is at position 17, so a(1) = 17.
The first run of exactly 2 zeros is at position 1, so a(2) = 1.
		

Crossrefs

Programs

  • Python
    import gmpy2
    gmpy2.get_context().precision = 2000000
    pi = gmpy2.const_pi()
    # Convert Pi to binary representation
    binary_pi = gmpy2.digits(pi, 2)[0] # zero-th element is the string of bits
    outVec = []
    for lenRun in range(1,20):
      str0 = "".join( ["0" for _ in range (lenRun)])
      l1 = binary_pi.find("1"+str0+"1")
      outVec.append(l1)
    print(outVec)

Formula

a(n) >= A178708(n). - Michael S. Branicky, Dec 13 2024

Extensions

a(21)-a(31) from Michael S. Branicky, Dec 04 2024
Clarified definition, added escape clause - N. J. A. Sloane, Dec 23 2024

A178709 Position of start of first appearance of n consecutive 1's in the binary expansion of Pi.

Original entry on oeis.org

3, 11, 11, 11, 11, 11, 451, 645, 645, 645, 5212, 18123, 18123, 58276, 58276, 80697, 80697, 80697, 1146746, 1962901, 3296306, 9772065, 9772065, 9772065, 47536571, 169338693, 169338693, 207861698, 207861698, 207861698
Offset: 1

Views

Author

Will Nicholes, Jun 06 2010

Keywords

Comments

Out of the first 2^28 binary digits, 134220460 are "0" and 134214996 are "1". - Robert G. Wilson v, Jun 09 2010
This sequence ignores bits in the integer part of the binary expansion of Pi.

Examples

			6 consecutive 1's are first found beginning at the 11th position in Pi's binary expansion, so the sixth term in this sequence is 11.
		

Crossrefs

Programs

  • Mathematica
    pib = ToString@ FromDigits[ RealDigits[Pi - 3, 2, 2^28][[1]]]; f[n_] := 2 + StringPosition[ pib, ToString[(10^n - 1)/9], 1][[1, 1]]; Array[f, 30] (* Robert G. Wilson v, Jun 09 2010 *)

Extensions

a(14)-a(30) from Robert G. Wilson v, Jun 09 2010

A382307 Position of start of first run of alternating bit values in the base-2 representation of Pi, or -1 if no such run exists.

Original entry on oeis.org

1, 2, 2, 19, 19, 19, 19, 19, 1195, 1697, 1890, 1890, 1890, 1890, 15081, 63795, 206825, 206825, 206825, 470577, 470577, 557265, 557265, 557265, 557265, 557265, 447666572, 447666572, 699793337, 699793337, 2049646803, 2250772991
Offset: 1

Views

Author

James S. DeArmon, Mar 21 2025

Keywords

Comments

In base-2, Pi is: 11.00100100001111110110101010001... For this sequence, the integer part of Pi is ignored, and the first fractional bit is numbered one.
The bit substring may begin with either 0 or 1.
a(27) > 4*10^6. - Michael S. Branicky, Mar 23 2025
Conjecture: no term is -1 (would follow from a proof that Pi is normal in base 2). - Sean A. Irvine, Mar 30 2025
a(33) > 4*10^9. - Pontus von Brömssen, Apr 06 2025

Examples

			The first alternating bit run is "0", at position 1, so a(1) = 1. The second and third alternating bit runs are "01" and "010", starting at position 2, so a(2) and a(3) are both 2.
a(4)-a(8) = 19 since the binary digits of Pi are "10101010" starting at position 19.
		

Crossrefs

Programs

  • Python
    def binary_not(binary_string):
        return ''.join('1' if bit == '0' else '0' for bit in binary_string)
    # !pip install gmpy2   # may be necessary
    import gmpy2
    gmpy2.get_context().precision = 12000000
    pi = gmpy2.const_pi()
    # Convert Pi to binary representation
    binary_pi = gmpy2.digits(pi, 2)[0] # zero-th element is the string of bits
    binary_pi = binary_pi[2:] # remove leading "11" left of decimal point
    outVec = []
    strSearch0 = "" # this substring starts with "0"
    for lenRun in range(1,30):
      strSearch0 += "0" if lenRun%2==1 else "1"
      strSearch1 = binary_not(strSearch0)
      l0 = binary_pi.find(strSearch0)+1 # incr origin-0 result
      l1 = binary_pi.find(strSearch1)+1
      outVec.append(min(l0,l1))
    print(outVec)

Extensions

a(26)-a(32) from Pontus von Brömssen, Apr 06 2025
Showing 1-3 of 3 results.