OFFSET
0,3
LINKS
FORMULA
G.f.: (1 - 4*x + 7*x^2)/((1-x)^2*(1-3*x)).
a(n) = 3*a(n-1) + 2*(2*n - 3). - Vincenzo Librandi, Mar 13 2011
a(n) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3); a(0)=1, a(1)=1, a(2)=5. - Harvey P. Dale, Nov 24 2011
E.g.f.: exp(x)*(exp(2*x) - 2*x). - Elmo R. Oliveira, Sep 15 2024
MATHEMATICA
Table[3^n-2n, {n, 0, 30}] (* or *) LinearRecurrence[{5, -7, 3}, {1, 1, 5}, 30] (* Harvey P. Dale, Nov 24 2011 *)
PROG
(PARI) a(n)=3^n-2*n \\ Charles R Greathouse IV, Oct 16 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Barry, Mar 01 2011
EXTENSIONS
a(26)-a(29) from Elmo R. Oliveira, Sep 15 2024
STATUS
approved