[go: up one dir, main page]

login
In the binary race of Pi, where the race leader changes.
4

%I #10 Dec 08 2016 10:35:07

%S 1,7,17,33,6359,6363,6371,6385,6443,6445,6451,6465,6525,6527,6563,

%T 6565,6569,6571,6573,6693,6917,6923,6925,6965,6967,7003,7011,7337,

%U 7365,7367,7369,7383,7403,7705,7711,7763,7769,7773,7775,7789,7799,7801,7809,7811,7821,7823,7827,7829,7855,7895,7899

%N In the binary race of Pi, where the race leader changes.

%C In the binary expansion of Pi (A004601), where the number of zeros and the number of ones exchange the lead.

%C Obviously a(n) must be odd.

%C Not necessarily a(n)+1 = A039624(n); although every term here will be one greater than a term in A039624 except the initial one. As a result, this sequence is sparser than A039624.

%H Hans Havermann and Robert G. Wilson v, <a href="/A278920/b278920.txt">Table of n, a(n) for n = 1..823</a>

%H Hans Havermann, <a href="http://chesswanks.com/seq/b278920.txt">Table of n, a(n) for n = 1..73600</a>

%e 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.

%e a(2) = 7 since this is the first time the "zeros" take the lead.

%e a(3) = 17 since in the first 17 binary digits of Pi, the "ones" regain the count or lead.

%t 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

%Y Cf. A004601, A039624, A166006.

%K nonn

%O 1,2

%A _Hans Havermann_ and _Robert G. Wilson v_, Nov 30 2016