OFFSET
0,1
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) = (n+1)*(n+2)+(-1)^n = 2*binomial(n+2,2)+(-1)^n.
G.f.: (3-x)*(1+x^2)/((1-x)^3*(1+x)). [Colin Barker, Sep 03 2012]
From Wesley Ivan Hurt, Aug 09 2015: (Start)
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4), n>4.
a(n) = n^2+3n+3 if n is even, otherwise n^2+3n+1.
MAPLE
MATHEMATICA
Table[(n + 1) (n + 2) + (-1)^n, {n, 0, 70}] (* Wesley Ivan Hurt, Aug 09 2015 *)
LinearRecurrence[{2, 0, -2, 1}, {3, 5, 13, 19}, 50] (* Harvey P. Dale, Aug 02 2021 *)
PROG
(Magma) [(n + 1)*(n + 2) + (-1)^n: n in [0..50]]; // Vincenzo Librandi, Sep 06 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Barry, Mar 19 2003
STATUS
approved