login
A122520
Expansion of x*(1+2*x+3*x^2+4*x^3+4*x^4)/(1+x+x^2+x^3-x^5).
1
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, -38, -20, 43, 40, -50, -71, 61, 103, -53, -161, 40, 235, -11, -317, -68, 436, 184, -563, -374, 685, 688, -815, -1121, 874, 1747, -812, -2624, 568, 3742, 61, -5183, -1244, 6934, 3235, -8864, -6488, 10873
OFFSET
1,6
FORMULA
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
MATHEMATICA
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}};
w[1] = {1, 1, 1, 1, 1}; w[n_]:= w[n]= M.w[n-1];
Table[w[n][[1]], {n, 60}]
LinearRecurrence[{-1, -1, -1, 0, 1}, {1, 1, 1, 1, 1}, 61] (* G. C. Greubel, Oct 26 2024 *)
PROG
(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
(SageMath)
@CachedFunction # a = A122520
def a(n): return 1 if n<6 else -a(n-1) -a(n-2) -a(n-3) +a(n-5)
[a(n) for n in range(1, 61)] # G. C. Greubel, Oct 26 2024
CROSSREFS
Sequence in context: A127950 A069545 A353524 * A284995 A243005 A058393
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula, Sep 16 2006
EXTENSIONS
Sequence edited by Joerg Arndt, Colin Barker, Bruno Berselli, Oct 19 2012.
STATUS
approved