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.

A274581 Number T(n,k) of set partitions of [n] with alternating parity of elements and exactly k blocks; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 3, 1, 0, 1, 5, 7, 4, 1, 0, 1, 7, 14, 12, 5, 1, 0, 1, 11, 30, 33, 19, 6, 1, 0, 1, 15, 57, 84, 62, 27, 7, 1, 0, 1, 23, 119, 222, 204, 108, 37, 8, 1, 0, 1, 31, 224, 545, 627, 409, 169, 48, 9, 1, 0, 1, 47, 460, 1425, 2006, 1558, 763, 254, 61, 10, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 29 2016

Keywords

Examples

			T(5,1) = 1: 12345.
T(5,2) = 5: 1234|5, 123|45, 12|345, 145|23, 1|2345.
T(5,3) = 7: 123|4|5, 12|34|5, 12|3|45, 1|234|5, 145|2|3, 1|2|345, 1|23|45.
T(5,4) = 4: 12|3|4|5, 1|23|4|5, 1|2|34|5, 1|2|3|45.
T(5,5) = 1: 1|2|3|4|5.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,  1;
  0, 1,  2,   1;
  0, 1,  3,   3,   1;
  0, 1,  5,   7,   4,   1;
  0, 1,  7,  14,  12,   5,   1;
  0, 1, 11,  30,  33,  19,   6,   1;
  0, 1, 15,  57,  84,  62,  27,   7,  1;
  0, 1, 23, 119, 222, 204, 108,  37,  8, 1;
  0, 1, 31, 224, 545, 627, 409, 169, 48, 9, 1;
  ...
		

Crossrefs

Columns k=0-10 give: A000007, A057427, A052955(n-2) for n>1, A305777, A305778, A305779, A305780, A305781, A305782, A305783, A305784.
Diagonals include A000012, A001477, A077043.
Row sums give A274547.
T(n,ceiling(n/2)) gives A305785.
Cf. A124419, A274310 (parities alternate within blocks), A305823.

Programs

  • Maple
    b:= proc(l, i, t) option remember; `if`(l=[], x,
         `if`(l[1]=t, 0, expand(x*b(subsop(1=[][], l), 1, 1-t)
           ))+add(`if`(l[j]=t, 0, b(subsop(j=[][], l), j, 1-t)
           ), j=i..nops(l)))
        end:
    T:= n-> `if`(n=0, 1, (p-> seq(coeff(p, x, j), j=0..n))(
             b([seq(irem(i, 2), i=2..n)], 1$2))):
    seq(T(n), n=0..12);
  • Mathematica
    b[l_, i_, t_] := b[l, i, t] = If[l == {}, x, If[l[[1]] == t, 0, Expand[x*b[Rest[l], 1, 1 - t]]] + Sum[If[l[[j]] == t, 0, b[Delete[l, j], j, 1 - t]], {j, i, Length[l]}]];
    T[n_] := If[n==0, {1}, Function[p, Table[Coefficient[p, x, j], {j, 0, n}]][ b[Table[Mod[i, 2], {i, 2, n}], 1, 1]]];
    Flatten[Table[T[n], {n, 0, 12}]] (* Jean-François Alcover, May 27 2018, from Maple *)

Formula

Sum_{k=0..n} k * T(n,k) = A305823(n).