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.

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

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.

A363454 Number of partitions of [n] such that the number of blocks containing only odd elements equals the number of blocks containing only even elements and no block contains both odd and even elements.

Original entry on oeis.org

1, 0, 1, 1, 2, 4, 11, 28, 87, 266, 952, 3381, 13513, 53915, 237113, 1046732, 5016728, 24186664, 125121009, 652084528, 3615047527, 20211789423, 119384499720, 711572380960, 4455637803543, 28162688795697, 186152008588691, 1242276416218540, 8636436319397292
Offset: 0

Views

Author

Alois P. Heinz, Jun 02 2023

Keywords

Examples

			a(0) = 1: () the empty partition.
a(1) = 0.
a(2) = 1: 1|2.
a(3) = 1: 13|2.
a(4) = 2: 13|24, 1|2|3|4.
a(5) = 4: 135|24, 13|2|4|5, 15|2|3|4, 1|2|35|4.
a(6) = 11: 135|246, 13|24|5|6, 13|26|4|5, 13|2|46|5, 15|24|3|6, 1|24|35|6, 15|26|3|4, 15|2|3|46, 1|26|35|4, 1|2|35|46, 1|2|3|4|5|6.
a(7) = 28: 1357|246, 135|24|6|7, 137|24|5|6, 13|24|57|6, 135|26|4|7, 135|2|46|7, 137|26|4|5, 13|26|4|57, 137|2|46|5, 13|2|46|57, 13|2|4|5|6|7, 157|24|3|6, 15|24|37|6, 17|24|35|6, 1|24|357|6, 157|26|3|4, 15|26|37|4, 157|2|3|46, 15|2|37|46, 15|2|3|4|6|7, 17|26|35|4, 1|26|357|4, 17|2|35|46, 1|2|357|46, 1|2|35|4|6|7, 17|2|3|4|5|6, 1|2|37|4|5|6, 1|2|3|4|57|6.
		

Crossrefs

Bisection gives A047797 (even part).

Programs

  • Maple
    a:= n-> (h-> add(Stirling2(h, k)*Stirling2(n-h, k), k=0..h))(iquo(n, 2)):
    seq(a(n), n=0..40);
    # second Maple program:
    b:= proc(n, x, y) option remember; `if`(abs(x-y)>n, 0,
          `if`(n=0, 1, `if`(x>0, b(n-1, y, x)*x, 0)+b(n-1, y, x+1)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..40);

Formula

a(n) = Sum_{k=0..floor(n/2)} Stirling2(floor(n/2),k) * Stirling2(ceiling(n/2),k).
a(2n) = A047797(n).

A363472 Total number of blocks in all partitions of [n] where each block has at least one odd element and at least one even element.

Original entry on oeis.org

0, 0, 1, 1, 5, 13, 55, 193, 941, 4081, 22351, 113761, 694565, 4030153, 27107095, 175738753, 1289775821, 9209233921, 73147903471, 568928274961, 4857161139365, 40796613003433, 372190216061335, 3352314486348433, 32518958606637101, 312271731474218881
Offset: 0

Views

Author

Alois P. Heinz, Jun 05 2023

Keywords

Comments

All positive terms are odd.

Examples

			a(2) = 1: 12.
a(3) = 1: 123.
a(4) = 5 = 1 + 2 + 2: 1234, 12|34, 14|23.
a(5) = 13 = 1 + 2 + 2 + 2 + 2 + 2 + 2: 12345, 123|45, 125|34, 12|345, 134|25, 145|23, 14|235.
		

Crossrefs

Programs

  • Maple
    a:= n-> (h-> add(k*Stirling2(h, k)*Stirling2(n-h, k)*k!, k=0..h))(floor(n/2)):
    seq(a(n), n=0..30);

Formula

a(n) = Sum_{k=0..floor(n/2)} k * Stirling2(floor(n/2),k) * Stirling2(ceiling(n/2),k) * k!.
Showing 1-4 of 4 results.