OFFSET
0,2
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).
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
EXAMPLE
G.f. = 1 + 3*x + 9*x^2 + 30*x^3 + 99*x^4 + 324*x^5 + 1062*x^6 + 3483*x^7 + ...
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 *)
PROG
(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 */
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Nov 18 2003
STATUS
approved