OFFSET
0,2
COMMENTS
A133647 is a companion sequence.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,9).
FORMULA
For even n, a(n) = 3^n. For odd n, a(n) = 4 * 3^(n-1).
From R. J. Mathar, Oct 30 2008: (Start)
G.f.: (1+4*x)/((1+3*x)*(1-3*x)).
a(n) = 9*a(n-2). (End)
E.g.f.: (3*exp(3*x) + sinh(3*x))/3. - Andrew Howroyd, Jul 03 2024
EXAMPLE
a(4) = 3^4 = 81.
a(5) = 324 = 4 * 3^4.
MATHEMATICA
Table[3^(n - 2) ((-1)^n + 7)/2, {n, 1, 60}] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
LinearRecurrence[{0, 9}, {1, 4}, 30] (* Harvey P. Dale, Mar 27 2017 *)
PROG
(PARI) a(n) = (7*3^n - (-3)^n)/6 \\ Andrew Howroyd, Jul 03 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Sep 19 2007
EXTENSIONS
Name changed by Andrew Howroyd, Jul 03 2024
STATUS
approved