OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (15,-72,110).
FORMULA
a(n) = 25*a(n-1) - 246*a(n-2) + 1190*a(n-3) - 2828*a(n-4) + 2640*a(n-5) (follows from the minimal polynomial of M).
From Colin Barker, Dec 29 2016: (Start)
a(n) = (2*5^n +(5-sqrt(3))^n*(2+sqrt(3)) -(-2+sqrt(3))*(5+sqrt(3))^n)/6.
a(n) = 15*a(n-1) - 72*a(n-2) + 110*a(n-3) for n>2.
G.f.: (1 - 11*x + 29*x^2) / ((1 - 5*x)*(1 - 10*x + 22*x^2)). (End)
EXAMPLE
a(2) = 17 because the first row of M^2 is [26,-10,1,0,0].
MAPLE
with(linalg): M[1]:=matrix(5, 5, [5, -1, 0, 0, 0, -1, 5, -1, 0, 0, 0, -1, 5, -1, 0, 0, 0, -1, 5, -1, 0, 0, 0, -1, 5]): for n from 2 to 30 do M[n]:=multiply(M[1], M[n-1]) od: 1, seq(add(M[n][1, j], j=1..5), n=1..30);
a[0]:=1: a[1]:=4: a[2]:=17: a[3]:=77: a[4]:=371: for n from 5 to 20 do a[n]:=25*a[n-1]-246*a[n-2]+1190*a[n-3]-2828*a[n-4]+2640*a[n-5] od: seq(a[n], n=0..30);
MATHEMATICA
M = {{5, -1, 0, 0, 0}, {-1, 5, -1, 0, 0}, {0, -1, 5, -1, 0}, {0, 0, -1, 5, -1}, {0, 0, 0, -1, 5}}; v[1] = {1, 1, 1, 1, 1}; v[n_]:= v[n] = M.v[n-1]; Table[v[n][[1]], {n, 1, 30}]
CoefficientList[Series[(1-11*x+29*x^2)/((1-5*x)*(1-10*x+22*x^2)), {x, 0, 30}], x] (* G. C. Greubel, Aug 05 2019 *)
PROG
(PARI) Vec((1-11*x+29*x^2)/((1-5*x)*(1-10*x+22*x^2)) + O(x^30)) \\ Colin Barker, Dec 29 2016
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-11*x+29*x^2)/((1-5*x)*(1-10*x+22*x^2)) )); // G. C. Greubel, Aug 05 2019
(Sage) ((1-11*x+29*x^2)/((1-5*x)*(1-10*x+22*x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Aug 05 2019
(GAP) a:=[1, 4, 17];; for n in [4..30] do a[n]:=15*a[n-1]-72*a[n-2] + 110*a[n-3]; od; a; # G. C. Greubel, Aug 05 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson and Roger L. Bagula, Oct 27 2006
EXTENSIONS
Edited by N. J. A. Sloane, Nov 24 2006
STATUS
approved