OFFSET
1,1
LINKS
Hans Havermann, Table of n, a(n) for n = 1..2508
EXAMPLE
Ternary Pi is 10.01021101222201021100211...
With no digits of ternary Pi, there are an equal number of zeros and twos. 2 is in the sequence because with the initial 2 digits of ternary Pi, 0 has now taken the count lead over 2 (1-0). 14 is the next term because with 14 initial digits of ternary Pi, 2 has now taken the count lead over 0 (5-4). 17 is the next term because with 17 initial digits, 0 regains the count lead over 2 (6-5).
MATHEMATICA
pib = RealDigits[Pi, 3, 5000000][[1]]; flag = -1; z = o = t = 0; k = 1; lst = {}; While[k < 5000001, Switch[ pib[[k]], 0, z++, 1, o++, 2, t++]; If[(z > t && flag != 1) || (z < t && flag != -1), AppendTo[lst, k]; flag = -flag]; k++]; lst
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hans Havermann and Robert G. Wilson v, Dec 03 2016
STATUS
approved