OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
From Robert Israel, Jan 21 2018: (Start)
G.f.: (1+6*x+4*x^2+6*x^3+x^4)/((1+x)^2*(1-x)^3).
a(n) = (4+6*n+9*n^2)/4 if n is even, (7+12*n+9*n^2)/4 if n is odd. (End)
Sequence equals values of 9m^2 + 3m + 1 for m = 0, -1, 1, -2, 2, -3, 3, ... . - Greg Dresden, Jul 02 2018
MAPLE
seq((4+6*n+9*n^2+(3+6*n)*(n mod 2))/4, n=0..100); # Robert Israel, Jan 21 2018
MATHEMATICA
Sort[Table[9 m^2 + 3 m + 1, {m, -20, 20}]] (* Greg Dresden, Jul 02 2018 *)
Accumulate[LinearRecurrence[{0, 2, 0, -1}, {1, 6, 6, 18, 12}, 80]] (* Harvey P. Dale, Oct 02 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jan 21 2018
STATUS
approved