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-6 of 6 results.

A124424 Triangle read by rows: T(n,k) is the number of partitions of the set {1,2,...,n}, having exactly k blocks consisting of entries of the same parity (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 3, 4, 5, 2, 1, 7, 14, 16, 10, 4, 1, 25, 48, 61, 42, 20, 6, 1, 79, 194, 250, 200, 106, 38, 9, 1, 339, 820, 1145, 958, 569, 230, 66, 12, 1, 1351, 3794, 5554, 5096, 3251, 1486, 486, 112, 16, 1, 6721, 18960, 29101, 28010, 19110, 9470, 3477, 930, 175, 20, 1
Offset: 0

Views

Author

Emeric Deutsch, Nov 01 2006

Keywords

Comments

Row sums are the Bell numbers (A000110). T(n,0)=A124425(n).

Examples

			T(4,2) = 5 because we have 13|24, 14|2|3, 1|2|34, 1|23|4 and 12|3|4.
Triangle starts:
  1;
  0,  1;
  1,  0,  1;
  1,  2,  1,  1;
  3,  4,  5,  2, 1;
  7, 14, 16, 10, 4, 1;
  ...
		

Crossrefs

Programs

  • Maple
    Q[0]:=1: for n from 1 to 11 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 11 do P[n]:=sort(subs({s=t,x=1},Q[n])) od: for n from 0 to 11 do seq(coeff(P[n],t,j),j=0..n) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(g, u) option remember;
          add(Stirling2(g, k)*Stirling2(u, k)*k!, k=0..min(g, u))
        end:
    T:= proc(n, k) local g, u; g:= floor(n/2); u:= ceil(n/2);
          add(add(add(binomial(g, i)*Stirling2(i, h)*binomial(u, j)*
          Stirling2(j, k-h)*b(g-i, u-j), j=k-h..u), i=h..g), h=0..k)
        end:
    seq(seq(T(n,k), k=0..n), n=0..12);  # Alois P. Heinz, Oct 24 2013
  • Mathematica
    b[g_, u_] := b[g, u] = Sum[StirlingS2[g, k]*StirlingS2[u, k]*k!, {k, 0, Min[g, u]}] ; T[n_, k_] := Module[{g, u}, g = Floor[n/2]; u = Ceiling[n/2]; Sum[ Sum[ Sum[ Binomial[g, i]*StirlingS2[i, h]*Binomial[u, j]*StirlingS2[j, k-h]*b[g-i, u-j], {j, k-h, u}], {i, h, g}], {h, 0, k}]]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Feb 19 2015, after Alois P. Heinz *)

Formula

The generating polynomial of row n is P[n](t)=Q[n](t,t,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.
Sum_{k=0..n} k * T(n,k) = A363434(n). - Alois P. Heinz, Jun 01 2023

A363435 Number of partitions of [2n] having exactly n blocks with all elements of the same parity.

Original entry on oeis.org

1, 0, 5, 42, 569, 9470, 191804, 4534502, 122544881, 3721101192, 125331498349, 4634063018948, 186515332107196, 8114659545679752, 379362605925991692, 18961051425453713478, 1008752282616284996865, 56905048753221935350268, 3392250956149146382053539
Offset: 0

Views

Author

Alois P. Heinz, Jun 01 2023

Keywords

Examples

			a(2) = 5: 13|24, 14|2|3, 1|2|34, 1|23|4, 12|3|4.
		

Crossrefs

Programs

  • Maple
    g:= proc(n) option remember; `if`(n=0, 1, expand(x*
          add(g(n-j)*binomial(n-1, j-1), j=1..n)))
        end:
    S:= (n, k)-> coeff(g(n), x, k):
    b:= proc(g, u) option remember;
          add(S(g, k)*S(u, k)*k!, k=0..min(g, u))
        end:
    T:= proc(n, k) option remember; local g, u; g:= floor(n/2); u:= ceil(n/2);
          add(add(add(binomial(g, i)*S(i, h)*binomial(u, j)*
          S(j, k-h)*b(g-i, u-j), j=k-h..u), i=h..g), h=0..k)
        end:
    a:= n-> T(2*n, n):
    seq(a(n), n=0..18);
  • Mathematica
    b[g_, u_] := b[g, u] = Sum[StirlingS2[g, k]*StirlingS2[u, k]*k!, {k, 0, Min[g, u]}];
    T[n_, k_] := Module[{g, u}, g = Floor[n/2]; u = Ceiling[n/2]; Sum[Sum[Sum[ Binomial[g, i]*StirlingS2[i, h]*Binomial[u, j]*StirlingS2[j, k - h]*b[g - i, u - j], {j, k - h, u}], {i, h, g}], {h, 0, k}]];
    a[n_] := T[2n, n];
    Table[a[n], {n, 0, 18}] (* Jean-François Alcover, Oct 20 2023, after Alois P. Heinz in A124424 *)

Formula

a(n) = A124424(2n,n).
Conjecture: Limit_{n->oo} (a(n)/n!)^(1/n) = A238258 = -2 / (LambertW(-2*exp(-2)) * (2 + LambertW(-2*exp(-2)))) = 3.0882773... - Vaclav Kotesovec, Oct 21 2023

A363451 Number of partitions of [n] such that the number of blocks containing only odd elements equals the number of blocks containing only even elements.

Original entry on oeis.org

1, 0, 2, 2, 9, 23, 99, 353, 1778, 7927, 45273, 238797, 1526331, 9215950, 65020448, 439742641, 3388075807, 25270974635, 210763775071, 1713657668021, 15359474721088, 134902169999841, 1291589459223627, 12165062702520422, 123780591852786693, 1242763745129587332
Offset: 0

Views

Author

Alois P. Heinz, Jun 02 2023

Keywords

Examples

			a(0) = 1: () the empty partition.
a(1) = 0.
a(2) = 2: 12, 1|2.
a(3) = 2: 123, 13|2.
a(4) = 9: 1234, 12|34, 12|3|4, 13|24, 14|23, 1|23|4, 14|2|3, 1|2|34, 1|2|3|4.
a(5) = 23: 12345, 123|45, 123|4|5, 125|34, 12|345, 125|3|4, 12|35|4, 134|25, 134|2|5, 135|24, 13|25|4, 13|2|45, 13|2|4|5, 145|23, 14|235, 15|23|4, 1|235|4, 145|2|3, 14|2|35, 15|2|34, 1|2|345, 15|2|3|4, 1|2|35|4.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, x, y, m) option remember; `if`(n=0, `if`(x=y, 1, 0),
          `if`(x+m>0, b(n-1, y, x, m)*(x+m), 0)+b(n-1, y, x+1, m)+
          `if`(y>0, b(n-1, y-1, x, m+1)*y, 0))
        end:
    a:= n-> b(n, 0$3):
    seq(a(n), n=0..28);
  • Mathematica
    b[n_, x_, y_, m_] := b[n, x, y, m] = If[n == 0, If[x == y, 1, 0], If[x + m > 0, b[n - 1, y, x, m]*(x + m), 0] + b[n - 1, y, x + 1, m] + If[y > 0, b[n - 1, y - 1, x, m + 1]*y, 0]];
    a[n_] := b[n, 0, 0, 0];
    Table[a[n], {n, 0, 28}] (* Jean-François Alcover, Oct 20 2023, after Alois P. Heinz *)

A362495 Total number of blocks containing at least one odd element and at least one even element in all partitions of [n].

Original entry on oeis.org

0, 0, 1, 3, 13, 54, 262, 1294, 7109, 40367, 248651, 1587414, 10827740, 76494630, 571499993, 4414720825, 35798107309, 299547765240, 2616358573834, 23536296521084, 220030456297349, 2114721297588097, 21046291460160803, 214984439282684504, 2267305399918683232
Offset: 0

Views

Author

Alois P. Heinz, Jun 05 2023

Keywords

Examples

			a(3) = 3 = 1 + 1 + 0 + 1 + 0 : 123, 12|3, 13|2, 1|23, 1|2|3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, x, y, m) option remember; `if`(n=0, m,
          `if`(x+m>0, b(n-1, y, x, m)*(x+m), 0)+b(n-1, y, x+1, m)+
          `if`(y>0, b(n-1, y-1, x, m+1)*y, 0))
        end:
    a:= n-> b(n, 0$3):
    seq(a(n), n=0..25);

Formula

a(n) = Sum_{k=0..floor(n/2)} k * A124418(n,k).
a(n) = A138378(n) - A363434(n) = A005493(n-1) - A363434(n) for n>=1.

A363452 Total number of blocks containing only odd elements in all partitions of [n].

Original entry on oeis.org

0, 1, 1, 5, 12, 62, 206, 1189, 4949, 31775, 156972, 1110280, 6301550, 48637701, 310279615, 2591820857, 18293310174, 164218811718, 1267153412532, 12152174863961, 101557600812015, 1035203191874931, 9299499328238110, 100314319611860936, 962663031508255416
Offset: 0

Views

Author

Alois P. Heinz, Jun 02 2023

Keywords

Examples

			a(3) = 5 = 0 + 1 + 1 + 1 + 2 : 123, 12|3, 13|2, 1|23, 1|2|3.
		

Crossrefs

Programs

  • Maple
    b:= 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:
    a:= n-> add(b(n, k)*k, k=0..ceil(n/2)):
    seq(a(n), n=0..25);
    # second Maple program:
    b:= proc(n, x, y, m) option remember; `if`(n=0, y,
          `if`(x+m>0, b(n-1, y, x, m)*(x+m), 0)+b(n-1, y, x+1, m)+
          `if`(y>0, b(n-1, y-1, x, m+1)*y, 0))
        end:
    a:= n-> b(n, 0$3):
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, x_, y_, m_] := b[n, x, y, m] = If[n == 0, y,
         If[x + m > 0, b[n-1, y, x, m]*(x+m), 0] + b[n-1, y, x+1, m] +
         If[y > 0, b[n-1, y-1, x, m+1]*y, 0]];
    a[n_] := b[n, 0, 0, 0];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Dec 08 2023, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=0..ceiling(n/2)} k * A124420(n,k).
a(n) = A363434(n) - A363453(n).
a(2n) = A363453(2n).
a(2n+1) = A363453(2n+1) + A094577(n).

A363453 Total number of blocks containing only even elements in all partitions of [n].

Original entry on oeis.org

0, 0, 1, 2, 12, 35, 206, 780, 4949, 22686, 156972, 837333, 6301550, 38122554, 310279615, 2090641920, 18293310174, 135445359397, 1267153412532, 10202944645270, 101557600812015, 881921432827544, 9299499328238110, 86508104545175503, 962663031508255416
Offset: 0

Views

Author

Alois P. Heinz, Jun 02 2023

Keywords

Examples

			a(3) = 2 = 0 + 0 + 1 + 0 + 1 : 123, 12|3, 13|2, 1|23, 1|2|3.
		

Crossrefs

Programs

  • Maple
    b:= 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:
    a:= n-> add(b(n, k)*k, k=0..floor(n/2)):
    seq(a(n), n=0..25);
    # second Maple program:
    b:= proc(n, x, y, m) option remember; `if`(n=0, x,
          `if`(x+m>0, b(n-1, y, x, m)*(x+m), 0)+b(n-1, y, x+1, m)+
          `if`(y>0, b(n-1, y-1, x, m+1)*y, 0))
        end:
    a:= n-> b(n, 0$3):
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, x_, y_, m_] := b[n, x, y, m] = If[n == 0, x,
        If[x+m > 0, b[n-1, y, x, m]*(x+m), 0] + b[n-1, y, x+1, m] +
        If[y > 0, b[n-1, y-1, x, m+1]*y, 0]];
    a[n_] := b[n, 0, 0, 0];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Dec 08 2023, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=0..floor(n/2)} k * A124422(n,k).
a(n) = A363434(n) - A363452(n).
a(2n) = A363452(2n).
a(2n+1) = A363452(2n+1) - A094577(n).
Showing 1-6 of 6 results.