OFFSET
1,2
COMMENTS
Players A and B bet in a k-round game. Player A has an initial amount of money n. In each round, player A can wager an integer between 0 and what he has. Player A then gains or loses an amount equal to his wager depending on whether player B lets him win or lose. Player B tries to minimize player A's money at the end. The number of rounds player A can lose is r. a(n) is the maximum amount of money player A can have at the end of the game for k = 5 and r = 2.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
Charles Jwo-Yue Lien, Dynamic Betting Game, Southeast Asian Bulletin of Mathematics, 2015, Vol. 39 Issue 6, pp. 799-814.
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,1,-1).
FORMULA
With a(0)=0, a(n+1)-a(n) is a periodic function of n with value = 1,1,3,1,2,3,1,4.
a(n) = a(n-1) + a(n-8) - a(n-9). - Colin Barker, Sep 11 2014
G.f.: x*(4*x^7+x^6+3*x^5+2*x^4+x^3+3*x^2+x+1) / ((x-1)^2*(x+1)*(x^2+1)*(x^4+1)). - Colin Barker, Sep 11 2014
EXAMPLE
MATHEMATICA
LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 1, -1}, {1, 2, 5, 6, 8, 11, 12, 16, 17}, 60] (* Harvey P. Dale, Nov 21 2020 *)
PROG
(PARI) Vec(x*(4*x^7+x^6+3*x^5+2*x^4+x^3+3*x^2+x+1)/((x-1)^2*(x+1)*(x^2+1)*(x^4+1)) + O(x^100)) \\ Colin Barker, Sep 11 2014
(Haskell)
a247062 n = a247062_list !! (n-1)
a247062_list = [1, 2, 5, 6, 8, 11, 12, 16, 17] ++ zipWith (+)
(drop 8 a247062_list) (zipWith (-) (tail a247062_list) a247062_list)
-- Reinhard Zumkeller, Sep 19 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Charles Jwo-Yue Lien, Sep 10 2014
STATUS
approved