OFFSET
1,4
COMMENTS
Number of ways in which playing n one-card-poker games results in a payoff of $5.
x = # of games where player loses $2,
y = # of games where player loses $1,
z = # of games where player wins $1,
w = # of games where player wins $2.
The events i.e. winning $1, losing $2 etc. are mutually exclusive.
Hence in n games
x+y+z+w = n
-2x-y+z+2w = $5
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,0,-1,-1,1).
FORMULA
From Andrew Howroyd, Jan 12 2020: (Start)
a(n) = A253186(n-1).
a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6) for n > 6.
G.f.: x^3*(1 + x - x^3)/((1 - x)^3*(1 + x)*(1 + x + x^2)).
(End)
EXAMPLE
For n = 3, a(3) = 1, since the four-tuple <x=0, y=0, z=1, w=2> allows you to win $5 in 3 games. x + y + z + w = 1 + 2 =3, -2x - y + z + 2w = 1 + 2*2 = 5, as desired.
MAPLE
> fourples2 := proc (n) local i, c1, c2, c3, c4, c3positive, mylist, cash, k, howmanyways; cash := 2*n; for k from -cash to cash do i := 0; unassign(mylist); for c1 from 0 to n do c3positive := true; for c2 from 0 to n-c1 while c3positive do c3 := 2*n-4*c1-3*c2-k; if 0 <= c3 then c4 := n-c1-c2-c3; if 0 <= c4 then i := i+1; mylist[i] := [c1, c2, c3, c4] end if else c3positive := false end if end do end do; howmanyways[k] := [i, [seq(mylist[j], j = 1 .. i)]] end do; return howmanyways end proc; N := 20; for n to N do a := fourples2(n); points[n] := [n, a[5][1]] end do; seq(points[n], n = 1 .. N);
MATHEMATICA
LinearRecurrence[{1, 1, 0, -1, -1, 1}, {0, 0, 1, 2, 3, 4}, 100] (* Jean-François Alcover, Apr 11 2020 *)
PROG
(PARI) concat([0, 0], Vec((1 + x - x^3)/((1 - x)^3*(1 + x)*(1 + x + x^2)) + O(x^60))) \\ Andrew Howroyd, Jan 12 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Krishnan Sundararaman (krishnan.sundararaman(AT)enmu.edu), May 02 2009
EXTENSIONS
Terms a(13) and beyond from Andrew Howroyd, Jan 12 2020
STATUS
approved