OFFSET
0,4
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
a(n) = 2*a(n-1)+a(n-2)-4*a(n-3)+a(n-4)+2*a(n-5)-a(n-6).
a(n) = (2*n^3-2*n^2+n-1-(n-1)*(-1)^n)/8 = (n-1)*(2*n^2+1-(-1)^n)/8. - Luce ETIENNE, Jul 26 2014
G.f.: x^2*(x^3+x^2+3*x+1) / ((x-1)^4*(x+1)^2). - Colin Barker, Feb 17 2015
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[w + x == 2 y + 2 z, s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212561 *)
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {0, 0, 1, 5, 12, 26}, 50] (* Harvey P. Dale, Dec 04 2016 *)
PROG
(PARI) concat([0, 0], Vec(x^2*(x^3+x^2+3*x+1)/((x-1)^4*(x+1)^2) + O(x^100))) \\ Colin Barker, Feb 17 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 21 2012
STATUS
approved