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