OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(n) = 2*n^2 + 3 - n mod 2.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 5. - Colin Barker, May 24 2015
G.f.: -x*(3*x^4 - 3*x^3 - 2*x^2 + 9*x + 1) / ((x-1)^3*(x+1)). - Colin Barker, May 24 2015
MATHEMATICA
a[n_]:=If[n<2, n, 2*n^2+3-Mod[n, 2]] Table[a[n], {n, 0, 47}]
Join[{0, 1}, LinearRecurrence[{2, 0, -2, 1}, {11, 20, 35, 52}, 20]] (* G. C. Greubel, Apr 30 2018 *)
PROG
(PARI) Vec(-x*(3*x^4-3*x^3-2*x^2+9*x+1)/((x-1)^3*(x+1)) + O(x^100)) \\ Colin Barker, May 24 2015
(Magma) [0, 1] cat [2*n^2 + 3 - n mod 2: n in [2..100]]; / G. C. Greubel, Apr 30 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seppo Mustonen, May 28 2009
STATUS
approved