login
a(n) is the number of optimal strategies for Player I in the Penney-Ante game with strings of length n.
1

%I #28 Jun 04 2021 14:56:45

%S 4,2,2,2,6,10,22,42,86,166,338,666,1342,2662,5346,10650,21342,42598,

%T 85282,170398,340962,681586,1363510,2726354,5453374,10905406,21812154,

%U 43621646,87245954,174486562,348978470,697946290,1395903230,2791785118,5583591578,11167140558

%N a(n) is the number of optimal strategies for Player I in the Penney-Ante game with strings of length n.

%C See p. 5 of Phillips paper for details.

%H Michael De Vlieger, <a href="/A344903/b344903.txt">Table of n, a(n) for n = 3..3326</a>

%H Reed Phillips and A. J. Hildebrand, <a href="http://math.colgate.edu/~integers/v27/v27.mail.html">The number of optimal strategies in the Penney-Ante game</a>, Integers (2021) Vol. 21, #A27.

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Penney%27s_game">Penney's game</a>

%F a(3) = 4, a(4) = a(5) = 2, a(n) = 2 * a(n-1) - (-1)^n * a(Floor(n/2)+1) for n >= 6.

%t Block[{a}, a[3] = 4; a[4] = a[5] = 2; a[n_] := 2 a[n - 1] - (-1)^n*a[Floor[n/2] + 1]; Array[a[#] &, 36, 3]]

%t (* Second program, faster: *)

%t Block[{a = {0, 0, 4, 2, 2}}, Do[AppendTo[a, 2 a[[i - 1]] - (-1)^i*a[[Floor[i/2] + 1]]], {i, 6, 38}]; Drop[a, 2]] (* _Michael De Vlieger_, Jun 04 2021 *)

%K nonn,easy

%O 3,1

%A _Michael De Vlieger_, Jun 02 2021