OFFSET
0,3
COMMENTS
The number of quadruples of integers [x, u, v, w] which satisfy x > u > v > w >=0, n+5 = x+u, and either u+v <= x+w or x+u+v+w is even.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,1,0,-2,-2,0,1,2,0,-1).
FORMULA
EXAMPLE
G.f. = 1 + x + 3*x^2 + 4*x^3 + 8*x^4 + 9*x^5 + 16*x^6 + 18*x^7 + 28*x^8 + ...
MATHEMATICA
a[ n_] := Quotient[ 5 n^3 + If[ OddQ[n], 48 n^2 + 141 n + 162, 57 n^2 + 204 n + 288], 288];
a[ n_] := Module[{m = n}, SeriesCoefficient[ If[ n < 0, m = -7 - n; -1, 1] (1 - x^5)/((1 - x) (1 - x^2)^2 (1 - x^3) (1 - x^4)), {x, 0, m}]];
a[ n_] := Length @ FindInstance[ {x > u, u > v, v > w, w >= 0, x + u == n + 5, ((u + v <= x + w && x + u + v + w == 2 k + 1) || x + u + v + w == 2 k)}, {x, u, v, w, k}, Integers, 10^9];
PROG
(PARI) {a(n) = (5*n^3 + if( n%2, 48*n^2 + 141*n + 162, 57*n^2 + 204*n + 288 )) \ 288};
(PARI) {a(n) = my(s=(-1)^(n<0)); if( n<0, n = -7-n); s * polcoeff( (1 - x^5) / ((1 - x) * (1 - x^2)^2 * (1 - x^3) * (1 - x^4)) + x * O(x^n), n)};
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael Somos, Feb 09 2015
STATUS
approved