A098589 a(n) = 3*a(n-1) + 2*a(n-3), with a(0)=1, a(1)=3.
1, 3, 9, 29, 93, 297, 949, 3033, 9693, 30977, 98997, 316377, 1011085, 3231249, 10326501, 33001673, 105467517, 337055553, 1077170005, 3442445049, 11001446253, 35158678769, 112360926405, 359085671721, 1147574372701
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,0,2).
Crossrefs
Cf. A052541.
Programs
-
Magma
I:=[1,3,9]; [n le 3 select I[n] else 3*Self(n-1) + 2*Self(n-3): n in [1..30]]; // G. C. Greubel, Feb 03 2018
-
Mathematica
CoefficientList[Series[1/(1-3*x-2*x^3), {x,0,50}], x] (* or *) LinearRecurrence[{3,0,2},{1,3,9}, 50] (* G. C. Greubel, Feb 03 2018 *)
-
PARI
x='x+O('x^30); Vec(1/(1-3*x-2*x^3)) \\ G. C. Greubel, Feb 03 2018
Formula
G.f.: 1/(1-3*x-2*x^3).
a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..n} Sum_{j=0..i} C(n-2*k,i)*C(i,j) *C(j, k)*2^k.