login
Sum of first row of the 5 X 5 matrix M^n, where 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}}.
1

%I #19 Sep 08 2022 08:45:28

%S 1,4,17,77,371,1891,10123,56503,326699,1945799,11879987,74039167,

%T 469266331,3014973511,19581735203,128267231663,845770626539,

%U 5605309590679,37293554232307,248855791875007,1664285028373691,11148949376158631,74779855705724483

%N Sum of first row of the 5 X 5 matrix M^n, where 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}}.

%H Colin Barker, <a href="/A123952/b123952.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (15,-72,110).

%F 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).

%F From _Colin Barker_, Dec 29 2016: (Start)

%F a(n) = (2*5^n +(5-sqrt(3))^n*(2+sqrt(3)) -(-2+sqrt(3))*(5+sqrt(3))^n)/6.

%F a(n) = 15*a(n-1) - 72*a(n-2) + 110*a(n-3) for n>2.

%F G.f.: (1 - 11*x + 29*x^2) / ((1 - 5*x)*(1 - 10*x + 22*x^2)). (End)

%e a(2) = 17 because the first row of M^2 is [26,-10,1,0,0].

%p 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);

%p 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);

%t 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}]

%t 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 *)

%o (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

%o (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

%o (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

%o (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

%K nonn,easy

%O 0,2

%A _Gary W. Adamson_ and _Roger L. Bagula_, Oct 27 2006

%E Edited by _N. J. A. Sloane_, Nov 24 2006