login
Number of compositions of n into parts 2 and 3 with at least one 2 and one 3.
5

%I #25 Dec 21 2023 11:44:21

%S 0,0,0,0,0,2,0,3,3,4,6,9,10,16,20,27,36,49,63,86,113,150,199,265,349,

%T 465,615,815,1080,1432,1895,2513,3328,4409,5841,7739,10250,13581,

%U 17990,23832,31571,41824,55403,73396,97228,128800,170624,226030,299424,396655

%N Number of compositions of n into parts 2 and 3 with at least one 2 and one 3.

%C 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

%H Vincenzo Librandi, <a href="/A245332/b245332.txt">Table of n, a(n) for n = 0..1000</a>

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

%F 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).

%F 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

%e a(12) = number of rearrangements of 33222 = 5!/(3!*2!) = 10.

%t 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 *)

%o (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

%o (PARI)

%o x='x+O('x^66);

%o r=2; s=3;

%o gf = 1 + 1/(1-x^r-x^s) - 1/(1-x^r) - 1/(1-x^s);

%o Vec(gf)

%o \\ _Joerg Arndt_, Jul 24 2014

%K nonn,easy

%O 0,6

%A _David Neil McGrath_, Jul 18 2014

%E More terms from _Colin Barker_, Jul 18 2014