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

A363434 Total number of blocks containing only elements of the same parity in all partitions of [n].

Original entry on oeis.org

0, 1, 2, 7, 24, 97, 412, 1969, 9898, 54461, 313944, 1947613, 12603100, 86760255, 620559230, 4682462777, 36586620348, 299664171115, 2534306825064, 22355119509231, 203115201624030, 1917124624702475, 18598998656476220, 186822424157036439, 1925326063016510832
Offset: 0

Views

Author

Alois P. Heinz, Jun 01 2023

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    b:= proc(n, e, o, m) option remember; `if`(n=0, e+o,
          (e+m)*b(n-1, o, e, m)+b(n-1, o, e+1, m)+
           `if`(o=0, 0, o*b(n-1, o-1, e, m+1)))
        end:
    a:= n-> b(n, 0$3):
    seq(a(n), n=0..24);
  • Mathematica
    b[n_, e_, o_, m_] := b[n, e, o, m] = If[n == 0, e + o, (e + m)*b[n-1, o, e, m] + b[n - 1, o, e + 1, m] + If[o == 0, 0, o*b[n - 1, o - 1, e, m + 1]]];
    a[n_] := b[n, 0, 0, 0];
    Table[a[n], {n, 0, 24}] (* Jean-François Alcover, Sep 10 2023, after Alois P. Heinz *)

Formula

a(n) = Sum_{k=0..n} k * A124424(n,k).
a(n) = A363452(n) + A363453(n).
a(n) mod 2 = A000035(n).

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

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 *)
Showing 1-3 of 3 results.