A089978 Expansion of 1/(1-3x-3x^3).
1, 3, 9, 30, 99, 324, 1062, 3483, 11421, 37449, 122796, 402651, 1320300, 4329288, 14195817, 46548351, 152632917, 500486202, 1641103659, 5381209728, 17645087790, 57858574347, 189719352225, 622093320045, 2039855683176
Offset: 0
Examples
G.f. = 1 + 3*x + 9*x^2 + 30*x^3 + 99*x^4 + 324*x^5 + 1062*x^6 + 3483*x^7 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,0,3).
Programs
-
Mathematica
CoefficientList[Series[1/(1-3x-3x^3),{x,0,30}],x] (* or *) LinearRecurrence[ {3,0,3},{1,3,9},30] (* Harvey P. Dale, Jul 22 2015 *)
-
PARI
{a(n) = sum(k=0, n\3, binomial(n - 2*k, k) * 3^(n - 2*k))}; /* Michael Somos, Jan 30 2015 */
-
PARI
{a(n) = if( n<0, 0, polcoeff( 1 / (1 - 3*x - 3*x^3) + x * O(x^n), n))}; /* Michael Somos, Jan 30 2015 */
Formula
a(n) = Sum_{k=0..floor(n/2)} C(n-2*k, k)3^(n-2*k).
a(0)=1, a(1)=3, a(2)=9, a(n)=3*a(n-1)+3*a(n-3). - Harvey P. Dale, Jul 22 2015