OFFSET
0,3
COMMENTS
LINKS
Bruno Berselli, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1,0,0,1,-3,3,-1).
FORMULA
G.f.: x*(1+3*x+x^2+2*x^3+2*x^4+2*x^5+x^7) / ((1+x)*(1-x+x^2)*(1+x+x^2)*(1-x)^4).
a(n) = 3*a(n-1) -3*a(n-2) +a(n-3) +a(n-6) -3*a(n-7) +3*a(n-8) -a(n-9).
Also, for h>=0:
a(6h) = 6*h*( 12*h^2 + 3*h + 1 ),
a(6h+1) = 72*h^3 + 54*h^2 + 18*h + 1,
a(6h+2) = 6*( 4*h + 1 )*( 3*h^2 + 3*h + 1 ),
a(6h+3) = 2*( 36*h^3 + 63*h^2 + 39*h + 8 ),
a(6h+4) = 3*( 24*h^3 + 54*h^2 + 42*h + 11 ),
a(6h+5) = 72*h^3 + 198*h^2 + 186*h + 59.
MAPLE
seq(n+floor(n^2/2+n^3/3), n=0..43); # Paolo P. Lava, Aug 24 2018
MATHEMATICA
Table[n + Floor[n^2/2 + n^3/3], {n, 0, 50}]
CoefficientList[Series[x (1 + 3 x + x^2 + 2 x^3 + 2 x^4 + 2 x^5 + x^7)/((1 + x) (1 - x + x^2) (1 + x + x^2) (1 - x)^4), {x, 0, 50}], x] (* Vincenzo Librandi, Feb 08 2014 *)
PROG
(Magma) [n+Floor(n^2/2+n^3/3): n in [0..50]];
(Magma) I:=[0, 1, 6, 16, 33, 59, 96, 145, 210]; [n le 9 select I[n] else 3*Self(n-1)-3*Self(n-2)+Self(n-3)+Self(n-6)-3*Self(n-7)+3*Self(n-8)-Self(n-9): n in [1..50]]; // Vincenzo Librandi, Feb 08 2014
(PARI) vector(60, n, n--; n+floor(n^2/2 +n^3/3)) \\ G. C. Greubel, Aug 12 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Feb 07 2014
STATUS
approved