OFFSET
0,4
COMMENTS
Column k = 2 of triangle in A198295.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
G.f.: (x*(1+x)/(1-x^3))^2.
From Wesley Ivan Hurt, Apr 28 2015: (Start)
a(n) = 2*a(n-3)-a(n-6).
a(n) = (n+1+n*0^mod(n,3)-mod(n+1,3))/3. (End)
E.g.f.: (4/9)*x*exp(x) - (x/9)*exp(-x/2)*cos(sqrt(3)*x/2) - (sqrt(3)/9)*(2+x)*exp(-x/2)*sin(sqrt(3)*x/2). - Robert Israel, Apr 01 2016
MAPLE
f:= gfun:-rectoproc({a(n)=2*a(n-3)-a(n-6), seq(a(i) = [0, 0, 1, 2, 1, 2][i+1], i=0..5)}, a(n), remember):
map(f, [$0..100]); # Robert Israel, Apr 01 2016
MATHEMATICA
CoefficientList[Series[(x*(1 + x)/(1 - x^3))^2, {x, 0, 100}], x] (* Wesley Ivan Hurt, Apr 28 2015 *)
LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 0, 1, 2, 1, 2}, 100] (* Vincenzo Librandi, Apr 28 2015 *)
PROG
(Magma) I:=[0, 0, 1, 2, 1, 2]; [n le 6 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..80]]; // Vincenzo Librandi, Apr 28 2015
(PARI) vector(50, n, n--; (n+1+n*0^(n%3)-(n+1)%3)/3) \\ Derek Orr, Apr 28 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Philippe Deléham, Jan 21 2012
EXTENSIONS
More terms from Vincenzo Librandi, Apr 28 2015
STATUS
approved