OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,-2,-1,1).
FORMULA
From Colin Barker, Jun 30 2012: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4).
G.f.: (1 -2*x + 5*x^2 - 3*x^3)/((1 - x)^2*(1 - x - x^2)). (End)
MATHEMATICA
LinearRecurrence[{3, -2, -1, 1}, {1, 1, 6, 12}, 40] (* Harvey P. Dale, Dec 10 2014 *)
nxt[{n_, a_, b_}]:={n+1, b, a+b+n+3}; NestList[nxt, {1, 1, 1}, 40][[;; , 2]] (* Harvey P. Dale, Mar 19 2023 *)
CROSSREFS
Cf. A081659: a(n)=a(n-1)+a(n-2)+n-5, a(0)=a(1)=1 (except first 2 terms and sign).
Cf. A001924: a(n)=a(n-1)+a(n-2)+n-4, a(0)=a(1)=1 (except first 4 terms).
Cf. A000126: a(n)=a(n-1)+a(n-2)+n-2, a(0)=a(1)=1 (except first term).
Cf. A066982: a(n)=a(n-1)+a(n-2)+n-1, a(0)=a(1)=1.
Cf. A030119: a(n)=a(n-1)+a(n-2)+n, a(0)=a(1)=1.
Cf. A210677: a(n)=a(n-1)+a(n-2)+n+1, a(0)=a(1)=1.
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, May 09 2012
STATUS
approved