OFFSET
0,2
COMMENTS
Binomial transform of A084431.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,1,-3).
FORMULA
a(n) = (-10 - 3(-1)^n + 21*3^n)/8.
a(n) = 2*a(n-1) + 3*a(n-2) + 5, a(0)=0, a(1)=1. - Zerinvary Lajos, Dec 14 2008
From Stefano Spezia, Sep 20 2023: (Start)
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3) for n > 2.
E.g.f.: exp(x)*(9*cosh(2*x) + 12*sinh(2*x) - 5)/4. (End)
MAPLE
a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=2*a[n-1]+3*a[n-2]+5 od: seq(a[n], n=1..33); # Zerinvary Lajos, Dec 14 2008
MATHEMATICA
LinearRecurrence[{3, 1, -3}, {1, 7, 22}, 30] (* Harvey P. Dale, Sep 22 2023 *)
PROG
(Magma) [(-10-3*(-1)^n+21*3^n)/8: n in [0..30]]; // Vincenzo Librandi, Nov 16 2011
(PARI) Vec((1+4*x)/((1-x^2)*(1-3*x)) + O(x^30)) \\ Michel Marcus, Aug 14 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Jun 26 2003
STATUS
approved