OFFSET
0,6
COMMENTS
The g.f. for compositions of n into parts r, s with both parts present is 1 + 1/(1-x^r-x^s) - 1/(1-x^r) - 1/(1-x^s). - Joerg Arndt, Jul 24 2014
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1, 1, 3, 2, -1, -2, -1).
FORMULA
a(n) = a(n-2)+a(n-3)+b(n) with initial terms a(5)=2,a(6)=0,a(7)=3 and b(8)=1,b(9)=1,b(10)=0,b(11)=2,b(12)=0,b(13)=1 and b(n)=b(n-6).
G.f.: x^5*(x^2+2*x+2) / ((x-1)*(x+1)*(x^2+x+1)*(x^3+x^2-1)). - Colin Barker, Jul 18 2014
EXAMPLE
a(12) = number of rearrangements of 33222 = 5!/(3!*2!) = 10.
MATHEMATICA
CoefficientList[Series[x^5 (x^2 + 2 x + 2)/((x - 1) (x + 1) (x^2 + x + 1) (x^3 + x^2 - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 25 2014 *)
PROG
(PARI) a=vector(100); a[5]=2; a[7]=3; b=[1, 1, 0, 2, 0, 1]; k=1; for(n=8, #a, a[n]=a[n-2]+a[n-3]+b[k]; if(k==6, k=1, k++)); a \\ Colin Barker, Jul 18 2014
(PARI)
x='x+O('x^66);
r=2; s=3;
gf = 1 + 1/(1-x^r-x^s) - 1/(1-x^r) - 1/(1-x^s);
Vec(gf)
\\ Joerg Arndt, Jul 24 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Neil McGrath, Jul 18 2014
EXTENSIONS
More terms from Colin Barker, Jul 18 2014
STATUS
approved