login
Expansion of x*(1-6*x+7*x^2)/( (1-x)*(1+x)*(1-5*x+x^2)).
2

%I #17 Sep 17 2020 14:01:15

%S 0,1,-1,2,5,31,144,697,3335,15986,76589,366967,1758240,8424241,

%T 40362959,193390562,926589845,4439558671,21271203504,101916458857,

%U 488311090775,2339638995026,11209883884349,53709780426727,257339018249280,1232985310819681,5907587535849119

%N Expansion of x*(1-6*x+7*x^2)/( (1-x)*(1+x)*(1-5*x+x^2)).

%H <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (5,0,-5,1).

%F a(n)-a(n-2) = A030221(n-3), n>2. - _R. J. Mathar_, Dec 17 2017

%t m = 5 M = {{0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {1, m, 0, - m) Expand[Det[M - x*IdentityMatrix[4]]] (*-1 - 5 x + 5 x^3 + x^4*) NSolve[Det[M - x*IdentityMatrix[4]] == 0, x] v[1] = {0, 1, 1, 2}; v[n_] := v[n] = M . v[n - 1] digits = 50; aa = Table[Abs[v[n][[1]], {n, 1, digits}]

%t Clear[M, m, v, aa] (*A107389*)m = 5; M = {{0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {1, m, 0, - m}};Expand[Det[M - x*IdentityMatrix[4]]] ;NSolve[Det[M - x*IdentityMatrix[4]] == 0, x] ;v[1] = {0, 1, 1, 2}; v[n_] := v[n] = M . v[n - 1]; digits = 50; aa = Table[Abs[v[n][[1]]], {n, 1, digits}]

%t LinearRecurrence[{5,0,-5,1},{0,1,-1,2},30] (* _Harvey P. Dale_, Sep 17 2020 *)

%o (PARI) concat(0,Vec((1-6*x+7*x^2)/(1-x)/(1+x)/(1-5*x+x^2)+O(x^98))) \\ _Charles R Greathouse IV_, Jan 25 2012

%K sign,easy

%O 0,4

%A _Roger L. Bagula_, May 24 2005, corrected Sep 04 2008

%E Irregular sign at a(2) switched by R. J. Mathar, Jan 24 2012