OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3).
FORMULA
a(n) = 3*a(n-2)+7 for n > 2; a(1) = 4, a(2) = 7.
a(n) = (11-4*(-1)^n)*3^(1/4*(2*n-1+(-1)^n))/2-7/2.
G.f.: x*(4+3*x)/((1-x)*(1-3*x^2)).
MATHEMATICA
LinearRecurrence[{1, 3, -3}, {4, 7, 19}, 40] (* Harvey P. Dale, Aug 28 2016 *)
PROG
(Magma) T:=[ n le 2 select 5-n else 3*Self(n-2): n in [1..33] ]; [ n eq 1 select T[1] else Self(n-1)+T[n]: n in [1..#T]];
(PARI) a(n)=if(n%2, 15, 7)*3^(n\2)\2-3 \\ Charles R Greathouse IV, Jul 15 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Aug 11 2009
STATUS
approved