login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A344903
a(n) is the number of optimal strategies for Player I in the Penney-Ante game with strings of length n.
1
4, 2, 2, 2, 6, 10, 22, 42, 86, 166, 338, 666, 1342, 2662, 5346, 10650, 21342, 42598, 85282, 170398, 340962, 681586, 1363510, 2726354, 5453374, 10905406, 21812154, 43621646, 87245954, 174486562, 348978470, 697946290, 1395903230, 2791785118, 5583591578, 11167140558
OFFSET
3,1
COMMENTS
See p. 5 of Phillips paper for details.
LINKS
Reed Phillips and A. J. Hildebrand, The number of optimal strategies in the Penney-Ante game, Integers (2021) Vol. 21, #A27.
Wikipedia, Penney's game
FORMULA
a(3) = 4, a(4) = a(5) = 2, a(n) = 2 * a(n-1) - (-1)^n * a(Floor(n/2)+1) for n >= 6.
MATHEMATICA
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]]
(* Second program, faster: *)
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 *)
CROSSREFS
Sequence in context: A341686 A353636 A255909 * A198101 A364686 A341859
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Jun 02 2021
STATUS
approved