login
A278974
In the ternary Pi race between digits zero and one, where the race leader changes.
4
1, 3, 8, 1481, 1505, 1509, 1513, 1541, 1567, 1596, 1730, 1734, 1739, 1741, 1769, 1772, 1783, 1790, 66446, 66489, 66493, 66496, 68547, 68554, 68871, 69116, 69146, 69190, 69194, 69268, 69270, 69379, 69381, 69389, 241170
OFFSET
1,2
LINKS
Hans Havermann and Robert G. Wilson v, Table of n, a(n) for n = 1..395
EXAMPLE
Ternary Pi is 10.01021101222201021100211...
With no digits of ternary Pi, there are an equal number of zeros and ones. 1 is in the sequence because with the initial digit of ternary Pi, 1 has now taken the count lead over 0 (1-0). 3 is the next term because with 3 initial digits of ternary Pi, 0 has now taken the count lead over 1 (2-1). 8 is the next term because with 8 initial digits, 1 regains the count lead over 0 (4-3).
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 > o && flag != 1) || (z < o && flag != -1), AppendTo[lst, k]; flag = -flag]; k++]; lst
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved