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

A239317 Index of the first occurrence of a string of exactly n even numbers in the decimal expansion of Pi.

Original entry on oeis.org

3, 7, 53, 117, 33, 19, 965, 372, 1834, 70, 5876, 8878, 9288, 1279, 173580, 248625, 652113, 678288, 2199379, 1656691, 3455554, 30021792, 18707922, 26568757, 189709607, 36454145, 255896738, 388817627
Offset: 1

Views

Author

Kival Ngaokrajang, Mar 15 2014

Keywords

Comments

a(29) > 10^9
The string of even digits of length n must be preceded and followed by an odd digit. - Harvey P. Dale, Jan 27 2022

Examples

			Digit:         1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
Pi:            3 1 4 1 5 9 2 6 5  3  5  8  9  7  9 ...
Even string:   ...[1]......[2].........[1]............
                   .        .
                   .        .
                  a(1)     a(2)
                  = 3      = 7
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=389*10^6,dep},dep=If[EvenQ[#],1,0]&/@RealDigits[Pi,10,nn][[1]];Table[SequencePosition[dep,Join[{0},PadLeft[{0},n,1]],1][[1]],{n,2,29}][[All,1]]]+1 (* Harvey P. Dale, Jan 27 2022 *)
  • Python
    # Requires a text file "pib.txt" that contains the first billion digits of pi
    # without a decimal point or line breaks
    with open("pib.txt") as f:
        digits = f.read(1000000000)
        for a in range(1,30):
            found = False
            place = 0
            now = 0
            while place < 999999999:
                b = int(digits[place])
                c = int(digits[place+1])
                if b % 2 == 0:#digit is odd
                    now += 1
                else:
                    now = 0
                if now == a and c%2 == 1:
                    print(a,place-a+2)
                    found = True
                    break
                place += 1
            if not found:
                print("Not found in first billion digits.")
    # David Consiglio, Jr., Sep 22 2014
    # indentation corrected by David Radcliffe, May 09 2025

Extensions

More terms from David Consiglio, Jr., Sep 22 2014
Corrected and definition clarified by Harvey P. Dale, Jan 27 2022
Showing 1-1 of 1 results.