OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-5,2).
FORMULA
a(n) = 2*a(n-1) + 2*n + 1 (with a(1)=0).
From Colin Barker, Sep 18 2012: (Start)
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
G.f.: x^2*(5 - 3*x)/(1 - 4*x + 5*x^2 - 2*x^3). (End)
E.g.f.: (1/2)*(3 - (10 + 4*x)*exp(x) + 7*exp(2*x)). - G. C. Greubel, Jul 27 2016
MATHEMATICA
Table[(7*2^(n-1) - 2*n - 5), {n, 1, 40}] (* Vincenzo Librandi, Sep 18 2012 *)
LinearRecurrence[{4, -5, 2}, {0, 5, 17}, 25] (* G. C. Greubel, Jul 27 2016 *)
PROG
(Magma) I:=[0, 5, 17]; [n le 3 select I[n] else 4*Self(n-1)-5*Self(n-2)+2*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Sep 18 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Dec 01 2009
EXTENSIONS
Definition and examples simplified by Jon E. Schoenfield, Jun 19 2010
STATUS
approved