OFFSET
0,3
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,5,1).
FORMULA
a(n) = +3*a(n-1) +5*a(n-2) +a(n-3). - R. J. Mathar, Dec 17 2010
G.f.: (1-x)^2 / ( (1+x)*(1-4*x-x^2) ). - R. J. Mathar, Dec 17 2010
a(n) = ((-1)^n + (-(2-sqrt(5))^n + (2+sqrt(5))^n) / sqrt(5)). - Colin Barker, Jun 06 2017
a(n) = -A033887(n) + 2*Sum_{k=0..n} A033887(k)*(-1)^(n-k). - Yomna Bakr and Greg Dresden, Jun 03 2024
MATHEMATICA
LinearRecurrence[{3, 5, 1}, {1, 1, 9}, 30] (* or *) CoefficientList[Series[ (1-x)^2/((1+x)(1-4*x-x^2)), {x, 0, 30}], x] (* Harvey P. Dale, Jun 20 2011 *)
PROG
(PARI) Vec((1-x)^2/((1+x)*(1-4*x-x^2)) + O(x^30)) \\ Colin Barker, Jun 06 2017
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)^2/((1+x)*(1-4*x-x^2)) )); // G. C. Greubel, Jun 08 2019
(Sage) ((1-x)^2/((1+x)*(1-4*x-x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jun 08 2019
(GAP) a:=[1, 1, 9];; for n in [4..30] do a[n]:=3*a[n-1]+5*a[n-2]+a[n-3]; od; a; # G. C. Greubel, Jun 08 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jun 17 2008
STATUS
approved