login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A239317
Index of the first occurrence of a string of exactly n even numbers in the decimal expansion of Pi.
1
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,1
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
EXAMPLE
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
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 *)
PROG
(Python)
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
CROSSREFS
KEYWORD
nonn,more,base
AUTHOR
Kival Ngaokrajang, Mar 15 2014
EXTENSIONS
More terms from David Consiglio, Jr., Sep 22 2014
Corrected and definition clarified by Harvey P. Dale, Jan 27 2022
STATUS
approved