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

A285849 Number T(n,k) of permutations of [n] with k ordered cycles such that equal-sized cycles are ordered with increasing least elements; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 6, 1, 0, 6, 19, 18, 1, 0, 24, 100, 105, 40, 1, 0, 120, 508, 1005, 430, 75, 1, 0, 720, 3528, 6762, 6300, 1400, 126, 1, 0, 5040, 24876, 61572, 62601, 28700, 3822, 196, 1, 0, 40320, 219168, 558548, 706608, 431445, 105336, 9114, 288, 1
Offset: 0

Views

Author

Alois P. Heinz, Apr 27 2017

Keywords

Comments

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

Examples

			T(3,1) = 2: (123), (132).
T(3,2) = 6: (1)(23), (23)(1), (2)(13), (13)(2), (3)(12), (12)(3).
T(3,3) = 1: (1)(2)(3).
Triangle T(n,k) begins:
  1;
  0,    1;
  0,    1,     1;
  0,    2,     6,     1;
  0,    6,    19,    18,     1;
  0,   24,   100,   105,    40,     1;
  0,  120,   508,  1005,   430,    75,    1;
  0,  720,  3528,  6762,  6300,  1400,  126,   1;
  0, 5040, 24876, 61572, 62601, 28700, 3822, 196, 1;
		

Crossrefs

Row sums give A196301.
Main diagonal and first lower diagonal give: A000012, A002411.
T(2n,n) gives A285862.

Programs

  • Maple
    b:= proc(n, i, p) option remember; expand(`if`(n=0 or i=1,
          (p+n)!/n!*x^n, add(b(n-i*j, i-1, p+j)*(i-1)!^j*combinat
          [multinomial](n, n-i*j, i$j)/j!^2*x^j, j=0..n/i)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n$2, 0)):
    seq(T(n), n=0..12);
  • Mathematica
    multinomial[n_, k_List] := n!/Times @@ (k!);
    b[n_, i_, p_] := b[n, i, p] = Expand[If[n == 0 || i == 1, (p + n)!/n!*x^n, Sum[b[n - i*j, i - 1, p + j]*(i - 1)!^j*multinomial[n, Join[{n - i*j}, Table[i, j]]]/j!^2*x^j, {j, 0, n/i}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n}]][b[n, n, 0]];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Apr 28 2018, after Alois P. Heinz *)

A285917 Number of ordered set partitions of [n] into two blocks such that equal-sized blocks are ordered with increasing least elements.

Original entry on oeis.org

1, 6, 11, 30, 52, 126, 219, 510, 896, 2046, 3632, 8190, 14666, 32766, 59099, 131070, 237832, 524286, 956196, 2097150, 3841586, 8388606, 15425136, 33554430, 61908562, 134217726, 248377154, 536870910, 996183062, 2147483646, 3994427099, 8589934590, 16013066072
Offset: 2

Views

Author

Alois P. Heinz, Apr 28 2017

Keywords

Comments

a(n) is odd if and only if n = 2^k with k>0.

Crossrefs

Column k=2 of A285824.
Cf. A285853.

Programs

  • Maple
    a:= n-> 2*add(binomial(n, k), k=1..n/2)-
            `if`(n::even, 3/2*binomial(n, n/2), 0):
    seq(a(n), n=2..40);
    # second Maple program:
    a:= proc(n) option remember; `if`(n<5, [0, 1, 6, 11][n],
          (9*(n-1)*(n-4)*a(n-1)+2*(3*n^2-16*n+6)*a(n-2)
          -36*(n-2)*(n-4)*a(n-3)+8*(n-3)*(3*n-10)*a(n-4))
          /((3*n-13)*n))
        end:
    seq(a(n), n=2..40);
  • Mathematica
    a[n_] := 2*Sum[Binomial[n, k], {k, 1, n/2}] - If[EvenQ[n], 3/2*Binomial[n, n/2], 0];
    Table[a[n], {n, 2, 40}] (* Jean-François Alcover, May 26 2018, from Maple *)
  • PARI
    a(n) = 2*sum(k=1, n\2, binomial(n, k)) - if (!(n%2), 3*binomial(n, n/2)/2); \\ Michel Marcus, May 26 2018
Showing 1-2 of 2 results.