OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2).
FORMULA
a(n) = 2*a(n-2) + 7 for n > 2; a(1) = 5, a(2) = 7.
a(n) = (19 - 5*(-1)^n)*2^((2*n-1+(-1)^n)/4)/2 - 7.
G.f.: x*(5+2*x)/((1-x)*(1-2*x^2)).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3). - G. C. Greubel, Sep 12 2017
MATHEMATICA
Rest[CoefficientList[Series[x*(5 + 2*x)/((1 - x)*(1 - 2*x^2)), {x, 0, 50}], x]] (* or *) LinearRecurrence[{1, 2, -2}, {5, 7, 17}, 50] (* G. C. Greubel, Sep 12 2017 *)
PROG
(Magma) T:=[ n le 2 select 8-3*n else 2*Self(n-2): n in [1..38] ]; [ n eq 1 select T[1] else Self(n-1)+T[n]: n in [1..#T]];
(PARI) x='x+O('x^50); Vec(x*(5+2*x)/((1-x)*(1-2*x^2))) \\ G. C. Greubel, Sep 12 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Aug 10 2009
STATUS
approved