OFFSET
1,2
COMMENTS
In the binary expansion of Pi (A004601), where the number of zeros and the number of ones exchange the lead.
Obviously a(n) must be odd.
LINKS
Hans Havermann and Robert G. Wilson v, Table of n, a(n) for n = 1..823
Hans Havermann, Table of n, a(n) for n = 1..73600
EXAMPLE
Obviously a(1) = 1 is a term since in the binary expansion of Pi the first binary digit must be a one and therefore the "ones" take the lead.
a(2) = 7 since this is the first time the "zeros" take the lead.
a(3) = 17 since in the first 17 binary digits of Pi, the "ones" regain the count or lead.
MATHEMATICA
pib = RealDigits[Pi, 2, 10000][[1]]; flag = 1; z = o = 0; k = 1; lst = {}; While[k < 10001, If[pib[[k]] == 0, z++, o++]; If[(z > o && flag != 1) || (z < o && flag != -1), AppendTo[lst, k]; flag = -flag]; k++]; lst
CROSSREFS
KEYWORD
nonn
AUTHOR
Hans Havermann and Robert G. Wilson v, Nov 30 2016
STATUS
approved