OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
a(n) = (2*n^3+n)/3 - (2/3)*(2*floor((n+1)/2)^3 + floor((n+1)/2)) + (1-(-1)^n)/2.
G.f.: 4*x^2*(1+x+3*x^2+x^3)/(1-x)^4/(1+x)^3. - Colin Barker, Feb 12 2012
a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3) - 3*a(n-4) + 3*a(n-5) + a(n-6) - a(n-7); a(1)=0, a(2)=4, a(3)=8, a(4)=32, a(5)=48, a(6)=108, a(7)=144. - Harvey P. Dale, May 13 2012
MAPLE
A050442:=n->(2*n^3+n)/3-2/3*(2*floor((n+1)/2)^3+floor((n+1)/2))+(1-(-1)^n)/2: seq(A050442(n), n=1..50); # Wesley Ivan Hurt, Oct 10 2014
MATHEMATICA
Rest[CoefficientList[Series[4 x^2 (1+x+3 x^2+x^3)/(1-x)^4/(1+x)^3, {x, 0, 50}], x]] (* or *) LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {0, 4, 8, 32, 48, 108, 144}, 50] (* Harvey P. Dale, May 13 2012 *)
PROG
(Magma) [(2*n^3+n)/3-2/3*(2*Floor((n+1)/2)^3+Floor((n+1)/2))+(1-(-1)^n)/2: n in [1..50]]; // Vincenzo Librandi, Feb 12 2012
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Dec 23 1999
STATUS
approved