OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = (6*n + 5 + 3*(-1)^n)/4. - Jon E. Schoenfield, Jun 24 2010
G.f.: x*(2-x)*(1+2*x)/((1+x)*(1-x)^2). - Bruno Berselli, Feb 28 2012
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {2, 5, 5}, 70] (* Vincenzo Librandi, Feb 28 2012 *)
PROG
(Magma) I:=[2, 5, 5]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..40]]; // Vincenzo Librandi, Feb 28 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Nov 20 2009
STATUS
approved