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 A160138 #14 Apr 11 2020 15:33:06 %S A160138 0,0,1,2,3,4,6,7,9,11,13,15,18,20,23,26,29,32,36,39,43,47,51,55,60,64, %T A160138 69,74,79,84,90,95,101,107,113,119,126,132,139,146,153,160,168,175, %U A160138 183,191,199,207,216,224,233,242,251,260,270,279,289,299,309,319,330,340 %N A160138 a(n) = number of solutions to the system: x + y + z + w = n, -2x - y + z + 2w = 5 with nonnegative x, y, z, w. %C A160138 Number of ways in which playing n one-card-poker games results in a payoff of $5. %C A160138 x = # of games where player loses $2, %C A160138 y = # of games where player loses $1, %C A160138 z = # of games where player wins $1, %C A160138 w = # of games where player wins $2. %C A160138 The events i.e. winning $1, losing $2 etc. are mutually exclusive. %C A160138 Hence in n games %C A160138 x+y+z+w = n %C A160138 -2x-y+z+2w = $5 %H A160138 Andrew Howroyd, <a href="/A160138/b160138.txt">Table of n, a(n) for n = 1..1000</a> %H A160138 <a href="http://www.swansonsite.com/W/instructional/game_theory.pdf">One Card Poker</a> %H A160138 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,0,-1,-1,1). %F A160138 From _Andrew Howroyd_, Jan 12 2020: (Start) %F A160138 a(n) = A253186(n-1). %F A160138 a(n) = a(n-1) + a(n-2) - a(n-4) - a(n-5) + a(n-6) for n > 6. %F A160138 G.f.: x^3*(1 + x - x^3)/((1 - x)^3*(1 + x)*(1 + x + x^2)). %F A160138 (End) %e A160138 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. %p A160138 > 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); %t A160138 LinearRecurrence[{1, 1, 0, -1, -1, 1}, {0, 0, 1, 2, 3, 4}, 100] (* _Jean-François Alcover_, Apr 11 2020 *) %o A160138 (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 %Y A160138 Cf. A008806 is the number of ways in which playing n one-card-poker games results in a payoff of $0, i.e., the n-th term is the number of solutions to the system: x + y + z + w = n, -2x - y + z + 2w = 0, with nonnegative x, y, z, w. %Y A160138 Except for offset, same as A253186. %K A160138 nonn %O A160138 1,4 %A A160138 Krishnan Sundararaman (krishnan.sundararaman(AT)enmu.edu), May 02 2009 %E A160138 Terms a(13) and beyond from _Andrew Howroyd_, Jan 12 2020