login
Expansion of x*(1+2*x+3*x^2+4*x^3+4*x^4)/(1+x+x^2+x^3-x^5).
1

%I #20 Oct 26 2024 10:45:04

%S 1,1,1,1,1,-2,1,1,1,-2,-2,4,1,-2,-5,4,7,-5,-8,1,16,-2,-20,-2,25,13,

%T -38,-20,43,40,-50,-71,61,103,-53,-161,40,235,-11,-317,-68,436,184,

%U -563,-374,685,688,-815,-1121,874,1747,-812,-2624,568,3742,61,-5183,-1244,6934,3235,-8864,-6488,10873

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

%H G. C. Greubel, <a href="/A122520/b122520.txt">Table of n, a(n) for n = 1..1000</a>

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

%F G.f.: x*(1+2*x+3*x^2+4*x^3+4*x^4)/(1+x+x^2+x^3-x^5). - _Colin Barker_, Oct 19 2012

%t M= {{0,1,0,0,0}, {0,0,1,0,0}, {0,0,0,1,0}, {0,0,0,0,1}, {1,0,-1,-1,-1}};

%t w[1] = {1,1,1,1,1}; w[n_]:= w[n]= M.w[n-1];

%t Table[w[n][[1]], {n,60}]

%t LinearRecurrence[{-1,-1,-1,0,1}, {1,1,1,1,1}, 61] (* _G. C. Greubel_, Oct 26 2024 *)

%o (Magma) [n le 5 select 1 else -Self(n-1) -Self(n-2) -Self(n-3) +Self(n-5): n in [1..60]]; // _G. C. Greubel_, Oct 26 2024

%o (SageMath)

%o @CachedFunction # a = A122520

%o def a(n): return 1 if n<6 else -a(n-1) -a(n-2) -a(n-3) +a(n-5)

%o [a(n) for n in range(1,61)] # _G. C. Greubel_, Oct 26 2024

%K sign,easy

%O 1,6

%A _Roger L. Bagula_, Sep 16 2006

%E Sequence edited by _Joerg Arndt_, _Colin Barker_, _Bruno Berselli_, Oct 19 2012.