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.

A278975 In the ternary Pi race between digits zero and two, where the race leader changes.

This page as a plain text file.
%I A278975 #12 Dec 06 2016 22:36:37
%S A278975 2,14,17,33,156,189,4853,5494,5541,5548,5663,5665,5668,5673,5686,5689,
%T A278975 5702,5704,5719,5732,5739,5831,5834,5839,5845,5847,5905,5913,5925,
%U A278975 5928,5950,5978,5980,5986,6000
%N A278975 In the ternary Pi race between digits zero and two, where the race leader changes.
%H A278975 Hans Havermann, <a href="/A278975/b278975.txt">Table of n, a(n) for n = 1..2508</a>
%e A278975 Ternary Pi is 10.01021101222201021100211...
%e A278975 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).
%t A278975 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
%Y A278975 Cf. A004602, A278920, A278974, A278976, A278978.
%K A278975 nonn,base
%O A278975 1,1
%A A278975 _Hans Havermann_ and _Robert G. Wilson v_, Dec 03 2016