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.
%I A276166 #17 Aug 27 2016 02:11:20 %S A276166 0,1,2,1,3,2,2,2,4,3,2,3,3,2,3,2,5,4,3,4,3,3,3,3,4,2,3,3,4,3,3,3,6,5, %T A276166 4,5,3,4,4,4,4,3,4,3,4,4,3,4,5,2,3,4,4,3,4,3,5,4,3,3,4,3,4,3,7,6,5,6, %U A276166 4,5,5,5,4,4,5,4,4,5,4,5,5,3,4,4,5,4,4 %N A276166 a(n) is the first player's score in a "Coins in a Row" game over the n-th row of A066099 using a minimax strategy. %C A276166 "Coins in a Row" is a game in which players alternate picking up coins of varying denominations from the end of the row in an attempt to collect as many points as possible. %D A276166 Peter Winkler, Mathematical Puzzles: A Connoisseur's Collection, A K Peters/CRC Press, 2003, pages 1-2. %H A276166 Peter Kagey, <a href="/A276166/b276166.txt">Table of n, a(n) for n = 0..10000</a> %F A276166 a(n) = A029837(n + 1) - A276167(n). %F A276166 a(n) = A276165(n) + A276167(n). %e A276166 Let [R,L,L,L] represent a game in which the first player takes the right coin, the second player takes the left coin, the first player takes the left coin, and the second player takes the left (only remaining) coin. %e A276166 A066099_Row(0) = [0]; a(0) = 0 via [L] %e A276166 A066099_Row(1) = [1]; a(1) = 1 via [L] %e A276166 A066099_Row(3) = [1,1]; a(3) = 1 via [R,L] %e A276166 A066099_Row(22) = [2,1,2]; a(22) = 3 via [L,R,L] %e A276166 A066099_Row(88) = [2,1,4]; a(88) = 5 via [R,L,L] %e A276166 A066099_Row(1418) = [2,1,4,2,2]; a(1418) = 5 via [L,R,R,R,L] %o A276166 (Haskell) %o A276166 minimaxDifference [] = 0 %o A276166 minimaxDifference as = max (head as - minimaxDifference (tail as)) (last as - minimaxDifference (init as)) %o A276166 minimaxScore as = (sum as + minimaxDifference as) `div` 2 %o A276166 a276166 = minimaxScore . a066099_row %Y A276166 Cf. A276163, A276164, A276165, A276167. %K A276166 nonn %O A276166 0,3 %A A276166 _Peter Kagey_, Aug 25 2016