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.

A242626 Number T(n,k) of compositions of n, where k is the difference between the number of odd parts and the number of even parts, both counted without multiplicity; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

1, 1, 1, 0, 1, 2, 2, 2, 3, 1, 2, 11, 2, 3, 2, 2, 14, 8, 6, 6, 33, 14, 11, 5, 15, 43, 45, 20, 44, 82, 99, 25, 6, 14, 74, 141, 230, 41, 12, 202, 260, 451, 85, 26, 6, 22, 351, 514, 953, 148, 54, 24, 766, 1049, 1798, 355, 104, 18, 104, 1301, 2321, 3503, 751, 194
Offset: 0

Views

Author

Alois P. Heinz, May 19 2014

Keywords

Comments

T(n^2,n) = T(n^2+n,-n) = n! = A000142(n) for n>=0.

Examples

			T(8,-1) = 15: [2,2,2,2], [1,1,2,4], [1,1,4,2], [1,2,1,4], [1,2,4,1], [1,4,1,2], [1,4,2,1], [2,1,1,4], [2,1,4,1], [2,4,1,1], [4,1,1,2], [4,1,2,1], [4,2,1,1], [4,4], [8].
Triangle T(n,k) begins:
: n\k : -3   -2    -1     0     1    2    3 ...
+-----+------------------------------------
:  0  :                   1;
:  1  :                         1;
:  2  :             1,    0,    1;
:  3  :                   2,    2;
:  4  :             2,    3,    1,   2;
:  5  :                  11,    2,   3;
:  6  :       2,    2,   14,    8,   6;
:  7  :             6,   33,   14,  11;
:  8  :       5,   15,   43,   45,  20;
:  9  :            44,   82,   99,  25,   6;
: 10  :      14,   74,  141,  230,  41,  12;
: 11  :           202,  260,  451,  85,  26;
: 12  :  6,  22,  351,  514,  953, 148,  54;
: 13  :      24,  766, 1049, 1798, 355, 104;
: 14  : 18, 104, 1301, 2321, 3503, 751, 194;
		

Crossrefs

Row sums give A011782.
Cf. A242498 (compositions with multiplicity), A242618 (partitions without multiplicity).

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          expand(add(`if`(j=0, 1, x^(2*irem(i, 2)-1))*
          b(n-i*j, i-1, p+j)/j!, j=0..n/i))))
        end:
    T:= n->(p->seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(b(n$2, 0)):
    seq(T(n), n=0..20);
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n==0, p!, If[i<1, 0, Expand[Sum[If[j==0, 1, x^(2*Mod[i, 2]-1)]*b[n-i*j, i-1, p+j]/j!, {j, 0, n/i}]]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, Exponent[p, x, Min], Exponent[p, x]}]][b[n, n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Jan 17 2017, translated from Maple *)