cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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, 465, 615, 815, 1080, 1432, 1895, 2513, 3328, 4409, 5841, 7739, 10250, 13581, 17990, 23832, 31571, 41824, 55403, 73396, 97228, 128800, 170624, 226030, 299424, 396655
Offset: 0

Views

Author

David Neil McGrath, Jul 18 2014

Keywords

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

Examples

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

Programs

  • 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 *)
  • 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

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

Extensions

More terms from Colin Barker, Jul 18 2014