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.

Showing 1-4 of 4 results.

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

A274859 Number A(n,k) of set partitions of [n] such that the difference between each element and its index (in the partition) is a multiple of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 5, 8, 1, 1, 2, 4, 15, 16, 1, 1, 2, 4, 8, 52, 32, 1, 1, 2, 4, 8, 18, 203, 64, 1, 1, 2, 4, 8, 16, 40, 877, 128, 1, 1, 2, 4, 8, 16, 32, 101, 4140, 256, 1, 1, 2, 4, 8, 16, 32, 68, 254, 21147, 512, 1, 1, 2, 4, 8, 16, 32, 64, 144, 723, 115975, 1024
Offset: 0

Views

Author

Alois P. Heinz, Jul 09 2016

Keywords

Examples

			Square array A(n,k) begins:
:   1,      1,    1,   1,   1,   1,   1, ...
:   1,      1,    1,   1,   1,   1,   1, ...
:   2,      2,    2,   2,   2,   2,   2, ...
:   4,      5,    4,   4,   4,   4,   4, ...
:   8,     15,    8,   8,   8,   8,   8, ...
:  16,     52,   18,  16,  16,  16,  16, ...
:  32,    203,   40,  32,  32,  32,  32, ...
:  64,    877,  101,  68,  64,  64,  64, ...
: 128,   4140,  254, 144, 128, 128, 128, ...
: 256,  21147,  723, 304, 264, 256, 256, ...
: 512, 115975, 2064, 692, 544, 512, 512, ...
		

Crossrefs

Programs

  • Maple
    b:= proc(l, k, i, t) option remember; `if`(l=[], 1, add(`if`(l[j]=t,
          b(subsop(j=[][], l), k, j, irem(1+t, k)), 0), j=[1, $i..nops(l)]))
        end:
    A:= (n, k)-> `if`(n=0, 1, `if`(k=0, 2^(n-1), b([seq(
                irem(i, k), i=2..n)], k, 1, irem(2, k)))):
    seq(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    b[l_, k_, i_, t_] := b[l, k, i, t] = If[l == {}, 1, Sum[If[l[[j]] == t, b[ReplacePart[l, j -> Nothing], k, j, Mod[1+t, k]], 0], {j, Prepend[ Range[i, Length[l]], 1]}]]; A[n_, k_] := If[n==0, 1, If[k==0, 2^(n-1), b[Flatten[Table[Mod[i, k], {i, 2, n}]], k, 1, Mod[2, k]]]]; Table[A[n, d - n], {d, 0, 15}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 02 2017, translated from Maple *)

A274310 Triangle read by rows: T(n,k) = number of parity alternating partitions of [n] into k blocks (1 <= k <= m).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 4, 1, 1, 6, 11, 6, 1, 1, 10, 28, 26, 9, 1, 1, 14, 61, 86, 50, 12, 1, 1, 22, 136, 276, 236, 92, 16, 1, 1, 30, 275, 770, 927, 530, 150, 20, 1, 1, 46, 580, 2200, 3551, 2782, 1130, 240, 25, 1, 1, 62, 1141, 5710, 12160, 12632, 6987, 2130, 355, 30, 1
Offset: 1

Views

Author

N. J. A. Sloane, Jun 23 2016

Keywords

Comments

The first element of any block may be odd or even and then the parity of terms alternates within each block. - Alois P. Heinz, Jun 28 2016
Let a(n,k,i) be the number of parity alternating partitions of n into k blocks, i of which have even maximal elements. Dzhumadil'daev and Yeliussizov, Proposition 5.3, give recurrences for a(n,k,i), which depend on the parity of n. It is easy to verify that the solution to these recurrences is given by a(2*n,k,i) = Stirling2(n,i)*Stirling2(n+1,k+1-i) and a(2*n+1,k,i) = Stirling2(n+1,i+1) * Stirling2(n+1,k-i). The formula below for the table entries T(n,k) follows from this observation. - Peter Bala, Apr 09 2018

Examples

			Triangle begins:
  1;
  1,   1;
  1,   2,   1;
  1,   4,   4,   1;
  1,   6,  11,   6,   1;
  1,  10,  28,  26,   9,   1;
  1,  14,  61,  86,  50,  12,   1;
  1,  22, 136, 276, 236,  92,  16,   1;
  ...
From _Alois P. Heinz_, Jun 28 2016: (Start)
T(5,1) = 1: 12345.
T(5,2) = 6: 1234|5, 123|45, 125|34, 12|345, 145|23, 1|2345.
T(5,3) = 11: 123|4|5, 12|34|5, 125|3|4, 12|3|45, 14|23|5, 1|234|5, 1|23|45, 145|2|3, 14|25|3, 1|25|34, 1|2|345.
T(5,4) = 6: 12|3|4|5, 1|23|4|5, 14|2|3|5, 1|2|34|5, 1|25|3|4, 1|2|3|45.
T(5,5) = 1: 1|2|3|4|5. (End)
		

Crossrefs

Row sums give A124419(n+1).

Programs

  • Maple
    A274310 := proc (n, k) local i;
    with(combinat):
       add(Stirling2(floor((1/2)*n+1), i+1)*Stirling2(floor((1/2)*n+1/2), k-i), i = 0..k-1);
    end proc:
    for n from 1 to 10 do
       seq(A274310(n, k), k = 1..n);
    end do; # Peter Bala, Apr 09 2018
  • Mathematica
    T[n_, k_] = Sum[StirlingS2[Floor[(n + 2)/2], i + 1] * StirlingS2[Floor[(n + 1)/2], k - i], {i, 0, k - 1}];
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, May 17 2018, after Peter Bala *)

Formula

T(n,k) = Sum_{i = 0..k-1} Stirling2(floor((n+2)/2), i+1) * Stirling2(floor((n+1)/2), k-i). - Peter Bala, Apr 09 2018

Extensions

More terms from Alois P. Heinz, Jun 26 2016

A363519 Number T(n,k) of partitions of [n] having exactly k parity changes within the partition, n>=0, 0<=k<=max(0,n-1), read by rows.

Original entry on oeis.org

1, 1, 0, 2, 0, 1, 4, 0, 3, 4, 8, 0, 2, 18, 14, 18, 0, 7, 27, 87, 42, 40, 0, 5, 102, 162, 360, 147, 101, 0, 20, 179, 866, 931, 1456, 434, 254, 0, 15, 675, 1746, 5836, 4755, 5778, 1619, 723, 0, 67, 1321, 9087, 16416, 36031, 22893, 23052, 5044, 2064, 0, 52, 5216, 19863, 93452, 117172, 206570, 115178, 94210, 20271, 6586
Offset: 0

Views

Author

Alois P. Heinz, Jun 07 2023

Keywords

Comments

The blocks are ordered with increasing least elements.

Examples

			T(4,1) = 3: 134|2, 13|24, 13|2|4.
T(4,2) = 4: 124|3, 14|23, 14|2|3, 1|24|3.
T(4,3) = 8: 1234, 123|4, 12|34, 12|3|4, 1|234, 1|23|4, 1|2|34, 1|2|3|4.
T(5,2) = 18: 1245|3, 124|35, 124|3|5, 134|25, 134|2|5, 13|245, 13|24|5, 13|2|45, 13|2|4|5, 14|235, 14|23|5, 14|25|3, 14|2|35, 14|2|3|5, 15|24|3, 1|245|3, 1|24|35, 1|24|3|5.
T(5,4) = 18: 12345, 1234|5, 123|45, 123|4|5, 12|345, 12|34|5, 12|3|45, 12|3|4|5, 145|23, 1|2345, 1|234|5, 1|23|45, 1|23|4|5, 145|2|3, 1|2|345, 1|2|34|5, 1|2|3|45, 1|2|3|4|5.
Triangle T(n,k) begins:
  1;
  1;
  0,  2;
  0,  1,    4;
  0,  3,    4,    8;
  0,  2,   18,   14,    18;
  0,  7,   27,   87,    42,    40;
  0,  5,  102,  162,   360,   147,   101;
  0, 20,  179,  866,   931,  1456,   434,   254;
  0, 15,  675, 1746,  5836,  4755,  5778,  1619,  723;
  0, 67, 1321, 9087, 16416, 36031, 22893, 23052, 5044, 2064;
  ...
		

Crossrefs

Column k=1 gives A363550.
Row sums give A000110.
T(n,max(0,n-1)) gives A274547.

Programs

  • Maple
    b:= proc(l, i, t) option remember; expand(`if`(l=[], 1,
          add((f-> b(subsop(j=[][], l), j, `if`(f, 1-t, t))*
          `if`(f, x, 1))(l[j]=t), j=[1, $i..nops(l)])))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(
             b([ seq(irem(i, 2), i=2..n)], 1, 0)):
    seq(T(n), n=0..12);
  • Mathematica
    b[l_, i_, t_] := b[l, i, t] = Expand[If[l == {}, 1, Sum[Function[f, b[ReplacePart[l, j -> Nothing], j, If[f, 1 - t, t]]*If[f, x, 1]][l[[j]] == t], {j, Join[{1}, Range[i, Length@l]]}]]];
    T[n_] := CoefficientList[b[ Table[Mod[i, 2], {i, 2, n}], 1, 0], x];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Nov 17 2023, after Alois P. Heinz *)

Formula

Sum_{k=0..max(0,n-1)} k * T(n,k) = A363549(n).
Showing 1-4 of 4 results.