A078038 Expansion of (1-x)/(1+x-2*x^2-x^3).
1, -2, 4, -7, 13, -23, 42, -75, 136, -244, 441, -793, 1431, -2576, 4645, -8366, 15080, -27167, 48961, -88215, 158970, -286439, 516164, -930072, 1675961, -3019941, 5441791, -9805712, 17669353, -31838986, 57371980, -103380599, 186285573, -335674791, 604865338, -1089929347, 1963985232
Offset: 0
Examples
From _Joerg Arndt_, May 21 2013: (Start) There are abs(a(6-1))=23 compositions of 6 where there is no rise between every second pair of parts: v v <--= no rise over these positions 01: [ 1 1 1 1 1 1 ] 02: [ 1 1 1 2 1 ] 03: [ 1 1 1 3 ] 04: [ 1 2 1 1 1 ] 05: [ 1 2 1 2 ] 06: [ 1 2 2 1 ] 07: [ 1 3 1 1 ] 08: [ 1 3 2 ] 09: [ 1 4 1 ] 10: [ 1 5 ] 11: [ 2 1 1 1 1 ] 12: [ 2 1 1 2 ] 13: [ 2 2 1 1 ] 14: [ 2 2 2 ] 15: [ 2 3 1 ] 16: [ 2 4 ] 17: [ 3 1 1 1 ] 18: [ 3 2 1 ] 19: [ 3 3 ] 20: [ 4 1 1 ] 21: [ 4 2 ] 22: [ 5 1 ] 23: [ 6 ] There are abs(a(6-1))=23 compositions of 6 where there is no fall between every second pair of parts, starting with the second and third part: v v <--= no fall over these positions 01: [ 1 1 1 1 1 1 ] 02: [ 1 1 1 1 2 ] 03: [ 1 1 1 3 ] 04: [ 1 1 2 1 1 ] 05: [ 1 1 2 2 ] 06: [ 1 1 3 1 ] 07: [ 1 1 4 ] 08: [ 1 2 2 1 ] 09: [ 1 2 3 ] 10: [ 1 5 ] 11: [ 2 1 1 1 1 ] 12: [ 2 1 1 2 ] 13: [ 2 1 2 1 ] 14: [ 2 1 3 ] 15: [ 2 2 2 ] 16: [ 2 4 ] 17: [ 3 1 1 1 ] 18: [ 3 1 2 ] 19: [ 3 3 ] 20: [ 4 1 1 ] 21: [ 4 2 ] 22: [ 5 1 ] 23: [ 6 ] (End)
Links
- Noam D. Elkies, New Directions in Enumerative Chess Problems., arXiv:math/0508645 [math.CO]; 2005; The Electronic Journal of Combinatorics, 11 (2), 2004-2005. [From _Johannes W. Meijer_, May 29 2010]
- Index entries for linear recurrences with constant coefficients, signature (-1,2,1).
Programs
-
Maple
with(GraphTheory): G:= PathGraph(6): A:=AdjacencyMatrix(G): nmax:=36; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[3,k], k=1..6) od: seq(a(n), n=0..nmax); # Johannes W. Meijer, May 29 2010
-
Mathematica
LinearRecurrence[{-1, 2, 1}, {1, -2, 4}, 40] (* Jean-François Alcover, Jan 08 2019 *) a[n_]:=Sum[(-(-2)^(n+1)Cos[(Pi r)/7]^n Cot[(Pi r)/14]Sin[(3Pi r)/7])/7,{r,1,5,2}] Table[a[n],{n,0,40}]//Round (* Herbert Kociemba, Sep 17 2020 *)
-
PARI
Vec((1-x)/(1+x-2*x^2-x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 25 2012
Formula
a(n+3) = -a(n+2)+2*a(n+1)+a(n), a(0)=1, a(1)=-2, a(2)=4. - Wouter Meeussen, Jan 02 2005
a(n) = (-1)^n * (A006053(n+1) + A006053(n+2)). G.f. of |a(n)|: (1+x)/(x^3 - 2*x^2 - x + 1). - Ralf Stephan, Aug 19 2013
a(n) = Sum_{r=1..6} ((-2)^n*(1-(-1)^r)*cos(Pi*r/7)^n*cot(Pi*r/14)*sin(3*Pi*r/7))/7. - Herbert Kociemba, Sep 17 2020
Comments