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 11 results. Next

A080107 Number of fixed points of permutation of SetPartitions under {1,2,...,n}->{n,n-1,...,1}. Number of symmetric arrangements of non-attacking rooks on upper half of n X n chessboard.

Original entry on oeis.org

1, 1, 2, 3, 7, 12, 31, 59, 164, 339, 999, 2210, 6841, 16033, 51790, 127643, 428131, 1103372, 3827967, 10269643, 36738144, 102225363, 376118747, 1082190554, 4086419601, 12126858113, 46910207114, 143268057587, 566845074703, 1778283994284, 7186474088735
Offset: 0

Views

Author

Wouter Meeussen, Mar 15 2003

Keywords

Comments

Even-numbered terms a(2k) are A002872: 2,7,31,164,999 ("Sorting numbers"); odd-numbered terms are its binomial transform, A080337. The symmetrical set partitions of {-n,...,-1,0,1,...,n} can be classified by the partition containing 0. Thus we get the sum over k of {n choose k} times the number of symmetrical set partitions of 2n-2k elements. - Don Knuth, Nov 23 2003
Number of partitions of n numbers that are symmetrical and cannot be nested (i.e., include a pattern of the form abab). - Douglas Boffey, May 21 2015
Number of achiral color patterns in a row or loop of length n. Two color patterns are equivalent if the colors are permuted. - Robert A. Russell, Apr 23 2018
Also the number of self-complementary set partitions of {1, ..., n}. The complement of a set partition pi of {1, ..., n} is defined as n + 1 - pi (elementwise) on page 3 of Callan. For example, the complement of {{1,5},{2},{3,6},{4}} is {{1,4},{2,6},{3},{5}}. - Gus Wiseman, Feb 13 2019

Examples

			Of the set partitions of 4, the following 7 are invariant under 1->4, 2->3, 3->2, 4->1: {{1,2,3,4}}, {{1,2},{3,4}}, {{1,4},{2,3}}, {{1,3},{2,4}}, {{1},{2,3},{4}}, {{1,4},{2},{3}}, {{1},{2},{3},{4}}, so a(4)=7.
For a(4)=7, the row patterns are AAAA, AABB, ABAB, ABBA, ABBC, ABCA, and ABCD (same as previous example).  The loop patterns are AAAA, AAAB, AABB, AABC, ABAB, ABAC, and ABCD. - _Robert A. Russell_, Apr 23 2018
From _Gus Wiseman_, Feb 13 2019: (Start)
The a(1) = 1 through a(5) = 12 self-complementary set partitions:
  {{1}}  {{12}}    {{123}}      {{1234}}        {{12345}}
         {{1}{2}}  {{13}{2}}    {{12}{34}}      {{1245}{3}}
                   {{1}{2}{3}}  {{13}{24}}      {{135}{24}}
                                {{14}{23}}      {{15}{234}}
                                {{1}{23}{4}}    {{1}{234}{5}}
                                {{14}{2}{3}}    {{12}{3}{45}}
                                {{1}{2}{3}{4}}  {{135}{2}{4}}
                                                {{14}{25}{3}}
                                                {{15}{24}{3}}
                                                {{1}{24}{3}{5}}
                                                {{15}{2}{3}{4}}
                                                {{1}{2}{3}{4}{5}}
(End)
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.5 (p. 765).

Crossrefs

Programs

  • Mathematica
    < Range[n, 1, -1]]; t= 1 + RankSetPartition /@ t; t= ToCycles[t]; t= Cases[t, {_Integer}]; Length[t], {n, 7}]
    (* second program: *)
    QB[n_, q_] := QB[n, q] = Sum[QB[j, q] QBinomial[n-1, j, q], {j, 0, n-1}] // FunctionExpand // Simplify; QB[0, q_]=1; QB[1, q_]=1; Table[cc = CoefficientList[QB[n, q], q]; cc.Table[(-1)^(k+1), {k, 1, Length[cc]}], {n, 0, 30}] (* Jean-François Alcover, Feb 29 2016, after Paul D. Hanna *)
    (* Ach[n, k] is the number of achiral color patterns for a row or loop of n
      colors containing exactly k different colors *)
    Ach[n_, k_] := Ach[n, k] = If[n<2, Boole[n==k && n>=0],
      k Ach[n-2, k] + Ach[n-2, k-1] + Ach[n-2, k-2]]
    Table[Sum[Ach[n, k], {k, 0, n}], {n, 0, 30}] (* Robert A. Russell, Apr 23 2018 *)
    x[n_] := x[n] = If[n < 2, n+1, 2x[n-1] + (n-1)x[n-2]]; (* A005425 *)
    Table[Sum[StirlingS2[Ceiling[n/2], k] x[k-Mod[n, 2]], {k, 0, Ceiling[n/2]}],
      {n, 0, 30}] (* Robert A. Russell, Apr 27 2018, after Knuth reference *)

Formula

Knuth gives recurrences and generating functions.
a(n) = Sum_{k=0..t(n)} (-1)^k*A125810(n,k) where A125810 is a triangle of coefficients for a q-analog of the Bell numbers and t(n)=A125811(n)-1. - Paul D. Hanna, Jan 19 2009
From Robert A. Russell, Apr 23 2018: (Start)
a(n) = Sum_{k=0..n} Ach(n,k) where
Ach(n,k) = [n>1]*(k*Ach(n-2,k)+Ach(n-2,k-1)+Ach(n-2,k-2)) + [n<2]*[n==k]*[n>=0].
a(n) = 2*A103293(n+1) - A000110(n). (End)
a(n) = [n==0 mod 2]*Sum_{k=0..n/2} Stirling2(n/2, k)*A005425(k) + [n==1 mod 2] * Sum_{k=1..(n+1)/2} Stirling2((n+1)/2, k) * A005425(k-1). (from Knuth reference)
a(n) = 2*A084708(n) - A084423(n). - Robert A. Russell, Apr 27 2018

Extensions

Offset set to 0 by Alois P. Heinz, May 23 2015

A381299 Irregular triangular array read by rows. T(n,k) is the number of ordered set partitions of [n] with exactly k descents, n>=0, 0<=k<=binomial(n,2).

Original entry on oeis.org

1, 1, 2, 1, 4, 4, 4, 1, 8, 12, 18, 18, 12, 6, 1, 16, 32, 60, 84, 100, 92, 76, 48, 24, 8, 1, 32, 80, 176, 300, 448, 572, 650, 658, 596, 478, 334, 206, 102, 40, 10, 1, 64, 192, 480, 944, 1632, 2476, 3428, 4300, 5008, 5372, 5356, 4936, 4220, 3316, 2392, 1556, 904, 456, 188, 60, 12, 1
Offset: 0

Views

Author

Geoffrey Critzer, Feb 19 2025

Keywords

Comments

Let p = ({b_1},{b_2},...,{b_m}) be an ordered set partition of [n] into m blocks for some m, 1<=m<=n. A descent in p is an ordered pair (x,y) in [n]X[n] such that x is in b_i, y is in b_j, iy.
T(n,binomial(n,2)) = 1 (counts the ordered set partition ({n},{n-1},...,{2},{1})).
For n>=1, T(n,0) = 2^(n-1).
Sum_{k>=0} T(n,k)*2^k = A289545(n).
Sum_{k>=0} T(n,k)*3^k = A347841(n).
Sum_{k>=0} T(n,k)*4^k = A347842(n).
Sum_{k>=0} T(n,k)*5^k = A347843(n).
Sum_{k>=0} T(n,k)*6^k = A385408(n).
Sum_{k>=0} T(n,k)*7^k = A347844(n).
Sum_{k>=0} T(n,k)*8^k = A347845(n).
Sum_{k>=0} T(n,k)*9^k = A347846(n).
T(n,k) is the number of preferential arrangements of n labeled elements with exactly k inversions. For example, there 4 preferential rearrangements of length 3 with 1 inversion: 132, 213, 212, 131. - Kyle Celano, Aug 18 2025

Examples

			Triangle T(n,k) begins:
  1;
  1;
  2,  1;
  4,  4,  4,  1;
  8, 12, 18, 18,  12,  6,  1;
 16, 32, 60, 84, 100, 92, 76, 48, 24, 8, 1;
 ...
		

Crossrefs

Columns k=0-2 give: A011782, A001787(n-1) for n>=1, 2*A268586.
Cf. A000670 (row sums), A008302 (the cases where each block has size 1).

Programs

  • Maple
    b:= proc(o, u, t) option remember; expand(`if`(u+o=0, 1, `if`(t=1,
          b(u+o, 0$2), 0)+add(x^(u+j-1)*b(o-j, u+j-1, 1), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=0..8);  # Alois P. Heinz, Feb 21 2025
  • Mathematica
    nn = 7; B[n_] := FunctionExpand[QFactorial[n, u]]; e[z_] := Sum[z^n/B[n], {n, 0, nn}];Map[CoefficientList[#, u] &, Table[B[n], {n, 0, nn}] CoefficientList[Series[1/(1 -(e[z] - 1)), {z, 0, nn}], z]] // Grid

Formula

Sum_{k=0..binomial(n,2)} k * T(n,k) = A240796(n). - Alois P. Heinz, Feb 20 2025
T(n,k) = Sum_{w} 2^(asc(w)), where w runs through the set of permutations with k inversions and asc(w) is the number of ascents of w. - Kyle Celano, Aug 18 2025

A125811 Number of coefficients in the n-th q-Bell number as a polynomial in q.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 8, 11, 15, 20, 26, 32, 39, 47, 56, 66, 76, 87, 99, 112, 126, 141, 156, 172, 189, 207, 226, 246, 267, 288, 310, 333, 357, 382, 408, 435, 463, 491, 520, 550, 581, 613, 646, 680, 715, 751, 787, 824, 862, 901, 941, 982, 1024, 1067, 1111, 1156, 1201
Offset: 0

Views

Author

Paul D. Hanna, Dec 10 2006

Keywords

Examples

			This sequence gives the number of terms in rows of A125810.
Row g.f.s B_q(n) of A125810 are polynomials in q generated by:
B_q(n) = Sum_{j=0..n-1} B_q(j) * C_q(n-1,j) for n>0 with B_q(0)=1
where the triangle of q-binomial coefficients C_q(n,k) begins:
  1;
  1, 1;
  1, 1 + q, 1;
  1, 1 + q + q^2, 1 + q + q^2, 1;
  1, 1 + q + q^2 + q^3, 1 + q + 2*q^2 + q^3 + q^4, 1 + q + q^2 + q^3, 1;
The initial q-Bell coefficients in B_q(n) are:
  B_q(0) = 1; B_q(1) = 1; B_q(2) = 2;
  B_q(3) = 4 + q;
  B_q(4) = 8 + 4*q + 3*q^2;
  B_q(5) = 16 + 12*q + 13*q^2 + 8*q^3 + 3*q^4;
  B_q(6) = 32 + 32*q + 42*q^2 + 38*q^3 + 33*q^4 + 15*q^5 + 10*q^6 + q^7.
		

Crossrefs

Programs

  • Maple
    Cq:= proc(n,k) local j; if n nops(Bq(n)): seq(a(n), n=0..60); # Alois P. Heinz, Aug 04 2009
  • Mathematica
    QB[n_, q_] := QB[n, q] = Sum[QB[j, q] QBinomial[n-1, j, q], {j, 0, n-1}] // FunctionExpand // Simplify; QB[0, q_]=1; QB[1, q_]=1; a[n_] := CoefficientList[QB[n, q], q] // Length; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 60}] (* Jean-François Alcover, Feb 29 2016 *)
  • PARI
    /* q-Binomial coefficients: */
    C_q(n,k)=if(n
    				
  • Python
    from math import comb, isqrt
    def A125811(n): return 1+comb(n,2)-sum(isqrt((k<<3)+1)-1>>1 for k in range(1,n)) # Chai Wah Wu, Feb 27 2025

Formula

a(n) = A023536(n-2) + 1.
a(n) = n*(n+1)/2 - 4 - Sum_{k=2..n-2} floor(1/2 + sqrt(2*k+4)) for n>2. [Due to a formula by Jan Hagberg in A023536]

Extensions

More terms from Alois P. Heinz, Aug 04 2009

A125812 q-Bell numbers for q=2; eigensequence of A022166, which is the triangle of Gaussian binomial coefficients [n,k] for q=2.

Original entry on oeis.org

1, 1, 2, 6, 28, 204, 2344, 43160, 1291952, 63647664, 5218320672, 719221578080, 168115994031040, 67159892835119296, 46166133463916209792, 54941957091151982047616, 113826217192695041078973184, 412563248965919999955196308224, 2627807814905396804499456018866688
Offset: 0

Views

Author

Paul D. Hanna, Dec 10 2006

Keywords

Examples

			The recurrence a(n) = Sum_{k=0..n-1} A022166(n-1,k) * a(k) is illustrated by:
a(2) = 1*(1) + 3*(1) + 1*(2) = 6;
a(3) = 1*(1) + 7*(1) + 7*(2) + 1*(6) = 28;
a(4) = 1*(1) + 15*(1) + 35*(2) + 15*(6) + 1*(28) = 204.
Triangle A022166 begins:
1;
1, 1;
1, 3, 1;
1, 7, 7, 1;
1, 15, 35, 15, 1;
1, 31, 155, 155, 31, 1;
1, 63, 651, 1395, 651, 63, 1; ...
		

Crossrefs

Programs

  • Maple
    b:= proc(o, u, t) option remember;
         `if`(u+o=0, 1, `if`(t>0, b(u+o, 0$2), 0)+add(2^(u+j-1)*
            b(o-j, u+j-1, min(2, t+1)), j=`if`(t=0, 1, 1..o)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..18);  # Alois P. Heinz, Feb 21 2025
  • Mathematica
    a[0] = 1; a[n_] := a[n] = Sum[QBinomial[n-1, k, 2] a[k], {k, 0, n-1}]; Table[a[n], {n, 0, 16}] (* Jean-François Alcover, Apr 09 2016 *)
  • PARI
    /* q-Binomial coefficients: */ {C_q(n,k)=if(n
    				

Formula

a(n) = Sum_{k=0..n-1} A022166(n-1,k) * a(k) for n>0, with a(0)=1.
a(n) = Sum_{k>=0} 2^k * A125810(n,k). - Alois P. Heinz, Feb 21 2025

A125813 q-Bell numbers for q=3; eigensequence of A022167, which is the triangle of Gaussian binomial coefficients [n,k] for q=3.

Original entry on oeis.org

1, 1, 2, 7, 47, 628, 17327, 1022983, 132615812, 38522717107, 25526768401271, 39190247441314450, 141213238745969102393, 1207367655155905204747681, 24733467452839301566047854678, 1224709126636123500201799360630423, 147747406166666863538672620806542995763
Offset: 0

Views

Author

Paul D. Hanna, Dec 10 2006

Keywords

Examples

			The recurrence: a(n) = Sum_{k=0..n-1} A022167(n-1,k) * a(k) is illustrated by:
  a(2) = 1*(1) + 4*(1) + 1*(2) = 7;
  a(3) = 1*(1) + 13*(1) + 13*(2) + 1*(7) = 47;
  a(4) = 1*(1) + 40*(1) + 130*(2) + 40*(7) + 1*(47) = 628.
Triangle A022167 begins:
  1;
  1, 1;
  1, 4, 1;
  1, 13, 13, 1;
  1, 40, 130, 40, 1;
  1, 121, 1210, 1210, 121, 1;
  1, 364, 11011, 33880, 11011, 364, 1;
  ...
		

Crossrefs

Programs

  • Maple
    b:= proc(o, u, t) option remember;
         `if`(u+o=0, 1, `if`(t>0, b(u+o, 0$2), 0)+add(3^(u+j-1)*
            b(o-j, u+j-1, min(2, t+1)), j=`if`(t=0, 1, 1..o)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..18);  # Alois P. Heinz, Feb 21 2025
  • Mathematica
    b[o_, u_, t_] := b[o, u, t] =
       If[u + o == 0, 1, If[t > 0, b[u + o, 0, 0], 0] + Sum[3^(u + j - 1)*
       b[o - j, u + j - 1, Min[2, t + 1]], {j, If[t == 0, {1}, Range[o]]}]];
    a[n_] := b[n, 0, 0];
    Table[a[n], {n, 0, 18}] (* Jean-François Alcover, Mar 15 2025, after Alois P. Heinz *)
  • PARI
    /* q-Binomial coefficients: */
    C_q(n,k)=if(n
    				

Formula

a(n) = Sum_{k=0..n-1} A022167(n-1,k) * a(k) for n>0, with a(0)=1.
a(n) = Sum_{k>=0} 3^k * A125810(n,k). - Alois P. Heinz, Feb 21 2025

A125815 q-Bell numbers for q=5; eigensequence of A022169, which is the triangle of Gaussian binomial coefficients [n,k] for q=5.

Original entry on oeis.org

1, 1, 2, 9, 103, 3276, 307867, 89520089, 83657942588, 258923776689771, 2717711483011792407, 98702105953049319472394, 12629828399521800714941435773, 5784963467206342855747483263957541, 9613516698678314330032600987632336641122, 58637855728567773833514895771659795097103477549
Offset: 0

Views

Author

Paul D. Hanna, Dec 10 2006

Keywords

Examples

			The recurrence: a(n) = Sum_{k=0..n-1} A022169(n-1,k) * a(k)
is illustrated by:
a(2) = 1*(1) + 6*(1) + 1*(2) = 9;
a(3) = 1*(1) + 31*(1) + 31*(2) + 1*(9) = 103;
a(4) = 1*(1) + 156*(1) + 806*(2) + 156*(9) + 1*(103) = 3276.
Triangle A022169 begins:
  1;
  1,    1;
  1,    6,      1;
  1,   31,     31,       1;
  1,  156,    806,     156,      1;
  1,  781,  20306,   20306,    781,    1;
  1, 3906, 508431, 2558556, 508431, 3906, 1;
  ...
		

Crossrefs

Programs

  • Maple
    b:= proc(o, u, t) option remember;
         `if`(u+o=0, 1, `if`(t>0, b(u+o, 0$2), 0)+add(5^(u+j-1)*
            b(o-j, u+j-1, min(2, t+1)), j=`if`(t=0, 1, 1..o)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..18);  # Alois P. Heinz, Feb 21 2025
  • Mathematica
    b[o_, u_, t_] := b[o, u, t] =
       If[u + o == 0, 1, If[t > 0, b[u + o, 0, 0], 0] + Sum[5^(u + j - 1)*
       b[o - j, u + j - 1, Min[2, t + 1]], {j, If[t == 0, {1}, Range[o]]}]];
    a[n_] := b[n, 0, 0];
    Table[a[n], {n, 0, 18}] (* Jean-François Alcover, Mar 15 2025, after Alois P. Heinz *)
  • PARI
    /* q-Binomial coefficients: */
    {C_q(n,k)=if(n
    				

Formula

a(n) = Sum_{k=0..n-1} A022169(n-1,k) * a(k) for n>0, with a(0)=1.
a(n) = Sum_{k>=0} 5^k * A125810(n,k). - Alois P. Heinz, Feb 21 2025

A125814 q-Bell numbers for q=4; eigensequence of A022168, which is the triangle of Gaussian binomial coefficients [n,k] for q=4.

Original entry on oeis.org

1, 1, 2, 8, 72, 1552, 84416, 12107584, 4726583424, 5150624868864, 16010990175691264, 144648776120641766400, 3857411545088966609514496, 307705704204270334224705015808, 74294186209325019487040708053442560, 54874536782175258883045772243829235417088
Offset: 0

Views

Author

Paul D. Hanna, Dec 10 2006

Keywords

Examples

			The recurrence: a(n) = Sum_{k=0..n-1} A022168(n-1,k) * a(k) is illustrated by:
  a(2) = 1*(1) + 5*(1) + 1*(2) = 8;
  a(3) = 1*(1) + 21*(1) + 21*(2) + 1*(8) = 72;
  a(4) = 1*(1) + 85*(1) + 357*(2) + 85*(8) + 1*(72) = 1552.
Triangle A022168 begins:
  1;
  1,    1;
  1,    5,     1;
  1,   21,    21,      1;
  1,   85,   357,     85,     1;
  1,  341,  5797,   5797,   341,    1;
  1, 1365, 93093, 376805, 93093, 1365, 1;
  ...
		

Crossrefs

Programs

  • Maple
    b:= proc(o, u, t) option remember;
         `if`(u+o=0, 1, `if`(t>0, b(u+o, 0$2), 0)+add(4^(u+j-1)*
            b(o-j, u+j-1, min(2, t+1)), j=`if`(t=0, 1, 1..o)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..18);  # Alois P. Heinz, Feb 21 2025
  • Mathematica
    b[o_, u_, t_] := b[o, u, t] =
       If[u + o == 0, 1, If[t > 0, b[u + o, 0, 0], 0] + Sum[4^(u + j - 1)*
       b[o - j, u + j - 1, Min[2, t + 1]], {j, If[t == 0, {1}, Range[o]]}]];
    a[n_] := b[n, 0, 0];
    Table[a[n], {n, 0, 18}] (* Jean-François Alcover, Mar 15 2025, after Alois P. Heinz *)
  • PARI
    /* q-Binomial coefficients: */
    {C_q(n,k)=if(n
    				

Formula

a(n) = Sum_{k=0..n-1} A022168(n-1,k) * a(k) for n>0, with a(0)=1.
a(n) = Sum_{k>=0} 4^k * A125810(n,k). - Alois P. Heinz, Feb 21 2025

A381369 A(n,k) is the sum over all partitions of [n] of k^j for a partition with j inversions; 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, 6, 15, 16, 1, 1, 2, 7, 28, 52, 32, 1, 1, 2, 8, 47, 204, 203, 64, 1, 1, 2, 9, 72, 628, 2344, 877, 128, 1, 1, 2, 10, 103, 1552, 17327, 43160, 4140, 256, 1, 1, 2, 11, 140, 3276, 84416, 1022983, 1291952, 21147, 512
Offset: 0

Views

Author

Alois P. Heinz, Feb 21 2025

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,    6,     7,     8,      9,     10, ...
   8,  15,   28,    47,    72,    103,    140, ...
  16,  52,  204,   628,  1552,   3276,   6172, ...
  32, 203, 2344, 17327, 84416, 307867, 915848, ...
		

Crossrefs

Columns k=0-5 give: A011782, A000110, A125812, A125813, A125814, A125815.
Main diagonal gives A381373.

Programs

  • Maple
    b:= proc(o, u, t, k) option remember;
         `if`(u+o=0, 1, `if`(t>0, b(u+o, 0$2, k), 0)+add(k^(u+j-1)*
            b(o-j, u+j-1, min(2, t+1), k), j=`if`(t=0, 1, 1..o)))
        end:
    A:= (n, k)-> b(n, 0$2, k):
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    Unprotect[Power]; 0^0 = 1; Protect[Power];
    b[o_, u_, t_, k_] := b[o, u, t, k] =
       If[u + o == 0, 1, If[t > 0, b[u + o, 0, 0, k], 0] + Sum[k^(u + j - 1)*
       b[o - j, u + j - 1, Min[2, t + 1], k], {j, If[t == 0, {1}, Range[o]]}]];
    A[n_, k_] := b[n, 0, 0, k];
    Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Mar 15 2025, after Alois P. Heinz *)

Formula

A(n,k) = Sum_{j>=0} k^j * A125810(n,j).

A381529 T(n,k) is the number of permutations of [n] having exactly k pairs of integers i=0, 0<=k<=A125811(n)-1, read by rows.

Original entry on oeis.org

1, 1, 2, 5, 1, 15, 5, 4, 54, 21, 24, 16, 5, 235, 89, 118, 112, 101, 35, 28, 2, 1237, 408, 577, 633, 719, 585, 402, 239, 167, 59, 14, 7790, 2106, 3023, 3529, 4410, 4463, 4600, 3012, 2789, 1933, 1438, 629, 442, 122, 34, 57581, 12529, 17693, 20980, 27208, 30064, 35359, 33332, 28137, 24970, 22850, 17148, 14272, 8645, 5639, 3684, 1809, 664, 282, 34
Offset: 0

Views

Author

Alois P. Heinz, Feb 26 2025

Keywords

Examples

			T(4,0) = 15: (1)(2)(3)(4), (1,2)(3)(4), (1)(2,3)(4), (1)(2)(3,4), (1,2)(3,4), (1,2,3)(4), (1,3,2)(4), (1)(2,3,4), (1)(2,4,3), (1,2,3,4), (1,2,4,3), (1,3,2,4), (1,3,4,2), (1,4,2,3), (1,4,3,2).
T(4,1) = 5: (1)(2,4)(3), (1,2,4)(3), (1,4,2)(3), (1,3)(2)(4), (1,3)(2,4).
T(4,2) = 4: (1,4)(2)(3), (1,4)(2,3), (1,3,4)(2), (1,4,3)(2).
Triangle T(n,k) begins:
     1;
     1;
     2;
     5,   1;
    15,   5,   4;
    54,  21,  24,  16,   5;
   235,  89, 118, 112, 101,  35,  28,   2;
  1237, 408, 577, 633, 719, 585, 402, 239, 167, 59, 14;
  ...
		

Crossrefs

Columns k=0-1 give: A051295, A381539.
Row sums give A000142.
Row lengths give A125811.
Last elements of rows give A381531.
Main diagonal gives A381545.
Cf. A008302, A125810 (similar for set partitions), A126673, A381299 (similar for ordered set partitions).

Programs

  • Maple
    b:= proc(o, u, t) option remember; expand(`if`(u+o=0, max(0, t-1)!,
         `if`(t>0, b(u+o, 0$2)*(t-1)!, 0)+add(x^(u+j-1)*
            b(o-j, u+j-1, t+1), j=`if`(t=0, 1, 1..o))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=0..10);

Formula

Sum_{k>=1} k * T(n,k) = A126673(n)/2.

A264082 Total number of inversions in all set partitions of [n].

Original entry on oeis.org

0, 0, 0, 1, 10, 74, 504, 3383, 23004, 160444, 1154524, 8594072, 66243532, 528776232, 4369175522, 37343891839, 329883579768, 3008985817304, 28312886239136, 274561779926323, 2741471453779930, 28159405527279326, 297291626845716642, 3223299667111201702
Offset: 0

Views

Author

Alois P. Heinz, Apr 03 2016

Keywords

Comments

Each set partition is written as a sequence of blocks, ordered by the smallest elements in the blocks.

Examples

			a(3) = 1: one inversion in 13|2.
a(4) = 10: one inversion in each of 124|3, 13|24, 13|2|4, 1|24|3, and two inversions in each of 134|2, 14|23, 14|2|3.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, [1, 0], add((p-> p+
          [0, p[1]*(j*t/2)])(b(n-j, t+j-1))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, 0)[2]:
    seq(a(n), n=0..23);  # Alois P. Heinz, Feb 20 2025
  • Mathematica
    b[n_, t_] := b[n, t] = If[n == 0, {1, 0}, Sum[Function[p, p+{0, p[[1]]*(j*t/2)}][b[n-j, t+j-1]]*Binomial[n-1, j-1], {j, 1, n}]];
    a[n_] := b[n, 0][[2]];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, May 21 2025, after Alois P. Heinz *)

Formula

a(n) = Sum_{k>0} k * A125810(n,k).
Showing 1-10 of 11 results. Next