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-10 of 18 results. Next

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

A124418 Triangle read by rows: T(n,k) is the number of partitions of the set {1,2,...,n} having exactly k blocks that contain both odd and even entries (0<=k<=floor(n/2)).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 4, 9, 2, 10, 30, 12, 25, 100, 72, 6, 75, 370, 372, 60, 225, 1369, 1922, 600, 24, 780, 5587, 9920, 4500, 360, 2704, 22801, 51200, 33750, 5400, 120, 10556, 101774, 273920, 234000, 55800, 2520, 41209, 454276, 1465472, 1622400, 576600, 52920, 720
Offset: 0

Views

Author

Emeric Deutsch, Oct 31 2006

Keywords

Comments

Row n has 1+floor(n/2) terms. Row sums are the Bell numbers (A000110). T(n,0)=A124419(n).

Examples

			T(4,1) = 9 because we have 1234, 134|2, 1|234, 124|3, 14|2|3, 1|2|34, 123|4, 1|23|4 and 12|3|4.
Triangle starts:
   1;
   1;
   1,   1;
   2,   3;
   4,   9,  2;
  10,  30, 12;
  25, 100, 72, 6;
  ...
		

Crossrefs

Programs

  • Maple
    Q[0]:=1: for n from 1 to 13 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: for n from 0 to 13 do P[n]:=sort(subs({t=1,s=1},Q[n])) od: for n from 0 to 13 do seq(coeff(P[n],x,j),j=0..floor(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    with(combinat):
    T:= proc(n, k) local g, u; g:= floor(n/2); u:=ceil(n/2);
          add(binomial(g, i)*stirling2(i, k)*bell(g-i), i=k..g)*
          add(binomial(u, i)*stirling2(i, k)*bell(u-i), i=k..u)*k!
        end:
    seq(seq(T(n,k), k=0..floor(n/2)), n=0..15); # Alois P. Heinz, Oct 23 2013
  • Mathematica
    T[n_, k_] := Module[{g = Floor[n/2], u = Ceiling[n/2]}, Sum[Binomial[g, i] * StirlingS2[i, k]*BellB[g-i], {i, k, g}]*Sum[Binomial[u, i]*StirlingS2[i, k] * BellB[u-i], {i, k, u}]*k!]; Table[Table[T[n, k], {k, 0, Floor[n/2]}], {n, 0, 15}] // Flatten (* Jean-François Alcover, Feb 20 2015, after Alois P. Heinz *)
  • PARI
    {T(n,k)=if(k<0||k>n,0, k!*(n\2)!*((n+1)\2)!*polcoeff(polcoeff(exp((1+y)*(exp(x+x*O(x^n))-1)),n\2),k) *polcoeff(polcoeff(exp((1+y)*(exp(x+x*O(x^n))-1)),(n+1)\2),k))} \\ Paul D. Hanna, Nov 08 2006

Formula

The generating polynomial of row n is P[n](x)=Q[n](1,1,x), where the polynomials Q[n]=Q[n](t,s,x) are defined by Q[0]=1; Q[n]=t*dQ[n-1]/dt + x*dQ[n-1]/ds + x*dQ[n-1]/dx + t*Q[n-1] if n is odd and Q[n]=x*dQ[n-1]/dt + s*dQ[n-1]/ds + x*dQ[n-1]/dx + s*Q[n-1] if n is even.
Conjecture: T(n,k) = k!*A049020([n/2],k)*A049020([(n+1)/2],k) where A049020(n,k)=Sum_{i=0..n} S2(n,i)*C(i,k) and S2(n,k)=(1/k!)*Sum_{j=0..k} (-1)^(k-j)*C(k,j)*j^n (the Stirling numbers of 2nd kind). - Paul D. Hanna, Nov 08 2006
Sum_{k=0..floor(n/2)} = k * A362495(n). - Alois P. Heinz, Jun 05 2023

A124421 Number of partitions of the set {1,2,...,n} having no blocks that contain only odd entries.

Original entry on oeis.org

1, 0, 1, 1, 5, 9, 52, 130, 855, 2707, 19921, 75771, 614866, 2717570, 24040451, 120652827, 1152972925, 6460552857, 66200911138, 408845736040, 4465023867757, 30083964854141, 348383154017581, 2539795748336375, 31052765897026352, 243282175672281360
Offset: 0

Views

Author

Emeric Deutsch, Oct 31 2006

Keywords

Comments

Column 0 of A124420.

Examples

			a(4) = 5 because we have 1234, 134|2, 14|23, 12|34 and 123|4.
		

Crossrefs

Bisection gives A108459 (even part).

Programs

  • Maple
    Q[0]:=1: for n from 1 to 27 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: for n from 0 to 27 do Q[n]:=Q[n] od: seq(subs({t=0,s=1,x=1},Q[n]),n=0..27);
    # second Maple program:
    a:= n-> add(Stirling2(floor(n/2), j)*j^ceil(n/2), j=0..floor(n/2)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 23 2013
  • Mathematica
    a[0] = 1; a[n_] := Sum[StirlingS2[Floor[n/2], j]*j^Ceiling[n/2], {j, 0, Floor[n/2]}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 20 2015, after Alois P. Heinz *)

Formula

a(n) = Q[n](0,1,1), where the polynomials Q[n]=Q[n](t,s,x) are defined by Q[0]=1; Q[n]=t*dQ[n-1]/dt + x*dQ[n-1]/ds + x*dQ[n-1]/dx + t*Q[n-1] if n is odd and Q[n]=x*dQ[n-1]/dt + s*dQ[n-1]/ds + x*dQ[n-1]/dx + s*Q[n-1] if n is even.
a(n) = Sum_{j=0..floor(n/2)} Stirling2(floor(n/2),j) * j^ceiling(n/2). - Alois P. Heinz, Oct 23 2013

A275069 Number A(n,k) of set partitions of [n] such that i-j is a multiple of k for all i,j belonging to the same block; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 5, 1, 1, 1, 1, 2, 15, 1, 1, 1, 1, 1, 4, 52, 1, 1, 1, 1, 1, 2, 10, 203, 1, 1, 1, 1, 1, 1, 4, 25, 877, 1, 1, 1, 1, 1, 1, 2, 8, 75, 4140, 1, 1, 1, 1, 1, 1, 1, 4, 20, 225, 21147, 1, 1, 1, 1, 1, 1, 1, 2, 8, 50, 780, 115975, 1
Offset: 0

Views

Author

Alois P. Heinz, Jul 15 2016

Keywords

Examples

			A(5,0) = 1: 1|2|3|4|5.
A(5,1) = 52 = A000110(5).
A(5,2) = 10: 135|24, 13|24|5, 135|2|4, 13|2|4|5, 15|24|3, 1|24|35, 1|24|3|5, 15|2|3|4, 1|2|35|4, 1|2|3|4|5.
A(5,3) = 4: 14|25|3, 14|2|3|5, 1|25|3|4, 1|2|3|4|5.
A(5,4) = 2: 15|2|3|4, 1|2|3|4|5.
Square array A(n,k) begins:
  1,      1,    1,   1,   1,  1,  1, 1, 1, 1, 1, ...
  1,      1,    1,   1,   1,  1,  1, 1, 1, 1, 1, ...
  1,      2,    1,   1,   1,  1,  1, 1, 1, 1, 1, ...
  1,      5,    2,   1,   1,  1,  1, 1, 1, 1, 1, ...
  1,     15,    4,   2,   1,  1,  1, 1, 1, 1, 1, ...
  1,     52,   10,   4,   2,  1,  1, 1, 1, 1, 1, ...
  1,    203,   25,   8,   4,  2,  1, 1, 1, 1, 1, ...
  1,    877,   75,  20,   8,  4,  2, 1, 1, 1, 1, ...
  1,   4140,  225,  50,  16,  8,  4, 2, 1, 1, 1, ...
  1,  21147,  780, 125,  40, 16,  8, 4, 2, 1, 1, ...
  1, 115975, 2704, 375, 100, 32, 16, 8, 4, 2, 1, ...
		

Crossrefs

A(k*n,n) for k=1-4 gives: A000012, A000079, A000351, A001024.

Programs

  • Maple
    with(combinat):
    A:= (n, k)-> mul(bell(floor((n+i)/k)), i=0..k-1):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    A[n_, k_] := Product[BellB[Floor[(n+i)/k]], {i, 0, k-1}]; Table[A[n, d-n], {d, 0, 14}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 17 2017, translated from Maple *)

Formula

A(n,k) = Product_{i=0..k-1} A000110(floor((n+i)/k)).

A124420 Triangle read by rows: T(n,k) is the number of partitions of the set {1,2,...,n}, having exactly k blocks consisting only odd entries (0<=k<=ceiling(n/2)).

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 3, 1, 5, 8, 2, 9, 26, 15, 2, 52, 101, 45, 5, 130, 385, 287, 70, 5, 855, 1889, 1143, 238, 15, 2707, 8295, 7320, 2475, 335, 15, 19921, 48382, 35805, 10540, 1275, 52, 75771, 240534, 240082, 100940, 19505, 1686, 52, 614866, 1609551, 1379753, 512710
Offset: 0

Views

Author

Emeric Deutsch, Oct 31 2006

Keywords

Comments

Row n has 1 + ceiling(n/2) terms. Row sums are the Bell numbers (A000110). T(2n,n) = T(2n+1,n+1) = A000110(n) (the Bell numbers). T(n,0) = A124421(n).

Examples

			T(4,1) = 8 because we have 13|24, 1|234, 124|3, 14|2|3, 1|2|34, 13|2|4, 1|23|4 and 12|3|4.
Triangle starts:
   1;
   0,   1;
   1,   1;
   1,   3,   1;
   5,   8,   2;
   9,  26,  15,   2;
  52, 101,  45,   5;
		

Crossrefs

Programs

  • Maple
    Q[0]:=1: for n from 1 to 13 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: for n from 0 to 13 do P[n]:=sort(subs({s=1,x=1},Q[n])) od: for n from 0 to 13 do seq(coeff(P[n],t,j),j=0..ceil(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    T:= proc(n, k) local g, u; g:= floor(n/2); u:=ceil(n/2);
          add(Stirling2(i, k)*binomial(u, i)*
          add(Stirling2(g, j)*j^(u-i), j=0..g), i=k..u)
        end:
    seq(seq(T(n,k), k=0..ceil(n/2)), n=0..15);  # Alois P. Heinz, Oct 23 2013
  • Mathematica
    T[n_, k_] := Module[{g = Floor[n/2], u = Ceiling[n/2]},
        Sum[StirlingS2[i, k]*Binomial[u, i]*
        Sum[StirlingS2[g, j]*If[u == i, 1, j^(u - i)], {j, 0, g}], {i, k, u}]];
    Table[Table[T[n, k], {k, 0, Ceiling[n/2]}], {n, 0, 15}] // Flatten (* Jean-François Alcover, May 20 2015, after Alois P. Heinz, updated Jan 01 2021 *)

Formula

The generating polynomial of row n is P[n](t)=Q[n](t,1,1), where the polynomials Q[n]=Q[n](t,s,x) are defined by Q[0]=1; Q[n]=t*dQ[n-1]/dt + x*dQ[n-1]/ds + x*dQ[n-1]/dx + t*Q[n-1] if n is odd and Q[n]=x*dQ[n-1]/dt + s*dQ[n-1]/ds + x*dQ[n-1]/dx + s*Q[n-1] if n is even.

A124422 Triangle read by rows: T(n,k) is the number of partitions of the set {1,2,...,n}, having exactly k blocks consisting only even entries (0<=k<=floor(n/2)).

Original entry on oeis.org

1, 1, 1, 1, 3, 2, 5, 8, 2, 22, 25, 5, 52, 101, 45, 5, 283, 423, 156, 15, 855, 1889, 1143, 238, 15, 5451, 9726, 5002, 916, 52, 19921, 48382, 35805, 10540, 1275, 52, 144074, 292223, 187515, 49155, 5400, 203, 614866, 1609551, 1379753, 512710, 89425, 7089, 203
Offset: 0

Views

Author

Emeric Deutsch, Oct 31 2006

Keywords

Comments

Row n has 1+floor(n/2) terms. Row sums are the Bell numbers (A000110). T(2n-1,n-1) = T(2n,n) = A000110(n) (the Bell numbers). T(n,0) = A124423(n).

Examples

			T(4,1) = 8 because we have 134|2, 13|24, 14|2|3, 1|24|3, 1|2|34, 123|4, 1|23|4 and 12|3|4.
Triangle starts:
   1;
   1;
   1,   1;
   3,   2;
   5,   8,  2;
  22,  25,  5;
  52, 101, 45, 5;
  ...
		

Crossrefs

Programs

  • Maple
    Q[0]:=1: for n from 1 to 13 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: for n from 0 to 13 do P[n]:=sort(subs({t=1,x=1},Q[n])) od: for n from 0 to 13 do seq(coeff(P[n],s,j),j=0..floor(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    T:= proc(n, k) local g, u; g:= floor(n/2); u:=ceil(n/2);
          add(Stirling2(i, k)*binomial(g, i)*
          add(Stirling2(u, j)*j^(g-i), j=0..u), i=k..g)
        end:
    seq(seq(T(n,k), k=0..floor(n/2)), n=0..15); # Alois P. Heinz, Oct 23 2013
  • Mathematica
    Unprotect[Power]; 0^0 = 1; T[n_, k_] := Module[{g = Floor[n/2], u = Ceiling[n/2]},  Sum[StirlingS2[i, k]*Binomial[g, i]*Sum[StirlingS2[u, j]*j^(g-i), {j, 0, u}], {i, k, g}]]; Table[Table[T[n, k], {k, 0, Floor[n/2]}], {n, 0, 15}] // Flatten (* Jean-François Alcover, May 22 2015, after Alois P. Heinz *)

Formula

The generating polynomial of row n is P[n](s)=Q[n](1,s,1), where the polynomials Q[n]=Q[n](t,s,x) are defined by Q[0]=1; Q[n]=t*dQ[n-1]/dt + x*dQ[n-1]/ds + x*dQ[n-1]/dx + t*Q[n-1] if n is odd and Q[n]=x*dQ[n-1]/dt + s*dQ[n-1]/ds + x*dQ[n-1]/dx + s*Q[n-1] if n is even.

A124423 Number of partitions of the set {1,2,...,n} having no blocks that contain only even entries.

Original entry on oeis.org

1, 1, 1, 3, 5, 22, 52, 283, 855, 5451, 19921, 144074, 614866, 4941987, 24040451, 211648665, 1152972925, 10998989896, 66200911138, 678600959525, 4465023867757, 48850849177703, 348383154017581, 4045835816532096, 31052765897026352, 381022649523561501
Offset: 0

Views

Author

Emeric Deutsch, Oct 31 2006

Keywords

Comments

Column 0 of A124422.

Examples

			a(4) = 5 because we have 1234, 14|23, 1|234, 124|3 and 12|34.
		

Crossrefs

Programs

  • Maple
    Q[0]:=1: for n from 1 to 27 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: for n from 0 to 27 do Q[n]:=Q[n] od: seq(subs({t=1,s=0,x=1},Q[n]),n=0..27);
    # second Maple program:
    a:= n-> add(Stirling2(ceil(n/2), j)*j^floor(n/2), j=0..ceil(n/2)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 23 2013
  • Mathematica
    a[0] = a[1] = 1; a[n_] := Sum[StirlingS2[Ceiling[n/2], j]*j^Floor[n/2], {j, 0, Ceiling[n/2]}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 22 2015, after Alois P. Heinz *)

Formula

a(n) = Q[n](1,0,1), where the polynomials Q[n]=Q[n](t,s,x) are defined by Q[0]=1; Q[n]=t*dQ[n-1]/dt + x*dQ[n-1]/ds + x*dQ[n-1]/dx + t*Q[n-1] if n is odd and Q[n]=x*dQ[n-1]/dt + s*dQ[n-1]/ds + x*dQ[n-1]/dx + s*Q[n-1] if n is even.
a(n) = Sum_{j=0..ceiling(n/2)} Stirling2(ceiling(n/2),j) * j^floor(n/2). - Alois P. Heinz, Oct 23 2013

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

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 4, 6, 4, 1, 10, 18, 17, 6, 1, 25, 61, 68, 38, 10, 1, 75, 210, 292, 202, 83, 14, 1, 225, 778, 1252, 1116, 576, 170, 22, 1, 780, 3008, 5670, 5928, 3899, 1490, 341, 30, 1, 2704, 12219, 26114, 32382, 25320, 12655, 3856, 678, 46, 1, 10556, 52268, 126073, 177666, 163695, 98282, 39230, 9418, 1319, 62, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 05 2023

Keywords

Examples

			T(4,0) = 4: 13|24, 13|2|4, 1|24|3, 1|2|3|4.
T(4,1) = 6: 124|3, 12|3|4, 134|2, 1|23|4, 14|2|3, 1|2|34.
T(4,2) = 4: 123|4, 12|34, 14|23, 1|234.
T(4,3) = 1: 1234.
T(5,2) = 17: 1235|4, 123|4|5, 1245|3, 12|34|5, 125|3|4, 12|3|45, 1345|2, 134|25, 14|235, 14|23|5, 15|234, 1|234|5, 1|23|45, 145|2|3, 14|25|3, 1|25|34, 1|2|345.
Triangle T(n,k) begins:
     1;
     1;
     1,     1;
     2,     2,     1;
     4,     6,     4,     1;
    10,    18,    17,     6,     1;
    25,    61,    68,    38,    10,     1;
    75,   210,   292,   202,    83,    14,    1;
   225,   778,  1252,  1116,   576,   170,   22,   1;
   780,  3008,  5670,  5928,  3899,  1490,  341,  30,  1;
  2704, 12219, 26114, 32382, 25320, 12655, 3856, 678, 46, 1;
  ...
		

Crossrefs

Columns k=0-2 give: A124419, A363511, A363588.
Row sums give A000110.
T(n+1,n) gives A000012.
T(n+2,n) gives A027383.
T(2n+1,n) gives A363495.

Programs

  • Maple
    b:= proc(n, x, y) option remember; `if`(n=0, 1,
         `if`(y=0, 0, expand(b(n-1, y-1, x+1)*y*z))+
            b(n-1, y, x)*x + b(n-1, y, x+1))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=0..12);
  • Mathematica
    b[n_, x_, y_] := b[n, x, y] = If[n == 0, 1,
      If[y == 0, 0, Expand[b[n - 1, y - 1, x + 1]*y*z]] +
      b[n - 1, y, x]*x + b[n - 1, y, x + 1]];
    T[n_] := CoefficientList[b[n, 0, 0], z];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Sep 05 2023, after Alois P. Heinz *)

Formula

Sum_{k=0..max(0,n-1)} k * T(n,k) = A363496(n).

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

A124425 Number of partitions of the set {1,2,...,n} having no blocks with all entries of the same parity.

Original entry on oeis.org

1, 0, 1, 1, 3, 7, 25, 79, 339, 1351, 6721, 31831, 179643, 979567, 6166105, 37852039, 262308819, 1784037031, 13471274401, 100285059751, 818288740923, 6604485845167, 57836113793305, 502235849694679, 4693153430067699, 43572170967012871, 432360767273547841
Offset: 0

Views

Author

Emeric Deutsch, Nov 01 2006

Keywords

Comments

Column 0 of A124424.

Examples

			a(4) = 3 because we have 1234, 14|23 and 12|34.
		

Crossrefs

Programs

  • Maple
    Q[0]:=1: for n from 1 to 27 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: seq(subs({t=0,s=0,x=1},Q[n]),n=0..27);
    # second Maple program:
    a:= proc(n) local g, u; g:= floor(n/2); u:= ceil(n/2);
          add(Stirling2(g, k)*Stirling2(u, k)*k!, k=0..g)
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 24 2013
  • Mathematica
    a[n_] := Module[{g=Floor[n/2], u=Ceiling[n/2]}, Sum[StirlingS2[g, k]*StirlingS2[u, k]*k!, {k, 0, g}]]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 26 2015, after Alois P. Heinz *)

Formula

a(n) = Q[n](0,0,1), where the polynomials Q[n]=Q[n](t,s,x) are defined by Q[0]=1; Q[n]=t*dQ[n-1]/dt + x*dQ[n-1]/ds + x*dQ[n-1]/dx + t*Q[n-1] if n is odd and Q[n]=x*dQ[n-1]/dt + s*dQ[n-1]/ds + x*dQ[n-1]/dx + s*Q[n-1] if n is even.
a(n) = Sum_{k=0..floor(n/2)} Stirling2(floor(n/2),k)*Stirling2(ceiling(n/2),k)*k!. - Alois P. Heinz, Oct 24 2013
Showing 1-10 of 18 results. Next