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.

A285439 Sum T(n,k) of the entries in the k-th cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 21, 12, 3, 132, 76, 28, 4, 960, 545, 235, 55, 5, 7920, 4422, 2064, 612, 96, 6, 73080, 40194, 19607, 6692, 1386, 154, 7, 745920, 405072, 202792, 75944, 18736, 2816, 232, 8, 8346240, 4484808, 2280834, 911637, 254061, 46422, 5256, 333, 9
Offset: 1

Views

Author

Alois P. Heinz, Apr 19 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			T(3,1) = 21 because the sum of the entries in the first cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+4+1+1 = 21.
Triangle T(n,k) begins:
       1;
       4,      2;
      21,     12,      3;
     132,     76,     28,     4;
     960,    545,    235,    55,     5;
    7920,   4422,   2064,   612,    96,    6;
   73080,  40194,  19607,  6692,  1386,  154,   7;
  745920, 405072, 202792, 75944, 18736, 2816, 232, 8;
  ...
		

Crossrefs

Columns k=1-2 give: A284816, A285489.
Row sums give A000142 * A000217 = A180119.
Main diagonal and first lower diagonal give: A000027, A006000 (for n>0).

Programs

  • Maple
    T:= proc(h) option remember; local b; b:=
          proc(n, l) option remember; `if`(n=0, [mul((i-1)!, i=l), 0],
            (p-> p+[0, (h-n+1)*p[1]*x^(nops(l)+1)])(b(n-1, [l[], 1]))+
             add((p-> p+[0, (h-n+1)*p[1]*x^j])(
             b(n-1, subsop(j=l[j]+1, l))), j=1..nops(l)))
          end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, [])[2])
        end:
    seq(T(n), n=1..10);
  • Mathematica
    T[h_] := T[h] = Module[{b}, b[n_, l_] := b[n, l] = If[n == 0, {Product[(i - 1)!, {i, l}], 0}, # + {0, (h - n + 1)*#[[1]]*x^(Length[l] + 1)}&[b[n - 1, Append[l, 1]]] + Sum[# + {0, (h-n+1)*#[[1]]*x^j}&[b[n - 1, ReplacePart[ l, j -> l[[j]] + 1]]], {j, 1, Length[l]}]]; Table[Coefficient[#, x, i], {i, 1, n}]&[b[h, {}][[2]]]];
    Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, May 25 2018, translated from Maple *)

Formula

Sum_{k=1..n} k * T(n,k) = n^2 * n! = A002775(n).

A284816 Sum of entries in the first cycles of all permutations of [n].

Original entry on oeis.org

1, 4, 21, 132, 960, 7920, 73080, 745920, 8346240, 101606400, 1337212800, 18920563200, 286442956800, 4620449433600, 79114299264000, 1433211107328000, 27387931963392000, 550604138692608000, 11617107089043456000, 256671161862635520000, 5926549291918295040000
Offset: 1

Views

Author

Alois P. Heinz, Apr 15 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.
Also, the number of colorings of n+1 given balls, two thereof identical, using n given colors (each color is used). - Ivaylo Kortezov, Jan 27 2024

Examples

			a(3) = 21 because the sum of the entries in the first cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+4+1+1 = 21.
		

Crossrefs

Column k=1 of A285439.

Programs

  • Maple
    a:= n-> n!*(n*(n+1)-(n-1)*(n+2)/2)/2:
    seq(a(n), n=1..25);
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n,
           (n^2+n+2)*n*a(n-1)/(n^2-n+2))
        end:
    seq(a(n), n=1..25);

Formula

a(n) = n!*(n*(n+1) - (n-1)*(n+2)/2)/2.
E.g.f.: -x*(x^2-2*x+2)/(2*(x-1)^3).
a(n) = (n^2+n+2)*n*a(n-1)/(n^2-n+2) for n > 1, a(n) = n for n < 2.
a(n) = n*A006595(n-1). - Ivaylo Kortezov, Feb 02 2024

A285424 Sum of the entries in the last blocks of all set partitions of [n].

Original entry on oeis.org

1, 5, 19, 75, 323, 1512, 7630, 41245, 237573, 1451359, 9365361, 63604596, 453206838, 3378581609, 26285755211, 212953670251, 1792896572319, 15658150745252, 141619251656826, 1324477898999161, 12791059496663293, 127395689514237279, 1307010496324272157
Offset: 1

Views

Author

Alois P. Heinz, Apr 18 2017

Keywords

Examples

			a(3) = 19 because the sum of the entries in the last blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 6+3+2+5+3 = 19.
		

Crossrefs

Column k=1 of A286232.

Programs

  • Maple
    a:= proc(h) option remember; local b; b:=
          proc(n, m, s) option remember; `if`(n=0, s,
            add(b(n-1, max(m, j), `if`(j
    				
  • Mathematica
    a[h_] := a[h] = Module[{b}, b[n_, m_, s_] := b[n, m, s] = If[n == 0, s,   Sum[b[n-1, Max[m, j], If[j < m, s, h - n + 1 + If[j == m, s, 0]]], {j, 1, m + 1}]]; b[h, 0, 0]];
    Array[a, 25] (* Jean-François Alcover, May 22 2018, translated from Maple *)

A286231 Sum T(n,k) of the entries in the k-th last cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 5, 1, 25, 10, 1, 143, 79, 17, 1, 942, 634, 197, 26, 1, 7074, 5462, 2129, 417, 37, 1, 59832, 51214, 23381, 5856, 786, 50, 1, 563688, 523386, 269033, 80053, 13934, 1360, 65, 1, 5858640, 5813892, 3281206, 1111498, 232349, 29728, 2204, 82, 1
Offset: 1

Views

Author

Alois P. Heinz, May 04 2017

Keywords

Examples

			T(3,2) = 10 because the sum of the entries in the second last cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 0+0+3+4+1+2 = 10.
Triangle T(n,k) begins:
       1;
       5,      1;
      25,     10,      1;
     143,     79,     17,     1;
     942,    634,    197,    26,     1;
    7074,   5462,   2129,   417,    37,    1;
   59832,  51214,  23381,  5856,   786,   50,  1;
  563688, 523386, 269033, 80053, 13934, 1360, 65, 1;
  ...
		

Crossrefs

Column k=1 gives A285382.
Main diagonal and first lower diagonal give: A000012, A002522.
Row sums give A000142 * A000217 = A180119.
Showing 1-4 of 4 results.