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

A361651 Number T(n,k) of permutations p of [n] such that p(i), p(i+k), p(i+2k),... form an up-down sequence for i in [k]; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 2, 3, 6, 0, 5, 6, 12, 24, 0, 16, 20, 30, 60, 120, 0, 61, 80, 90, 180, 360, 720, 0, 272, 350, 420, 630, 1260, 2520, 5040, 0, 1385, 1750, 2240, 2520, 5040, 10080, 20160, 40320, 0, 7936, 10080, 13440, 15120, 22680, 45360, 90720, 181440, 362880
Offset: 0

Views

Author

Alois P. Heinz, Mar 19 2023

Keywords

Comments

Number T(n,k) of permutations p of [n] such that p(i) < p(i+k) > p(i+2k) < ... for i <= k.
T(n,k) is defined for n,k >= 0. The triangle contains only the terms with k<=n. T(n,k) = n! for k>=n.

Examples

			Triangle T(n,k) begins:
  1;
  0,    1;
  0,    1,    2;
  0,    2,    3,    6;
  0,    5,    6,   12,   24;
  0,   16,   20,   30,   60,  120;
  0,   61,   80,   90,  180,  360,   720;
  0,  272,  350,  420,  630, 1260,  2520,  5040;
  0, 1385, 1750, 2240, 2520, 5040, 10080, 20160, 40320;
  ...
		

Crossrefs

Columns k=0-3 give: A000007, A000111, A361648, A367336.
Main diagonal gives A000142.
T(2n,n) gives A000680.

Programs

  • Maple
    b:= proc(u, o) option remember; `if`(u+o=0, 1,
          add(b(o-1+j, u-j), j=1..u))
        end:
    T:= (n, k)-> `if`(n=0, 1, `if`(k=0, 0, (l-> mul(b(s, 0), s=l)*
        combinat[multinomial](n, l[]))([floor((n+i)/k)$i=0..k-1]))):
    seq(seq(T(n, k), k=0..n), n=0..10);
  • Mathematica
    multinomial[n_, k_List] := n!/Times @@ (k!);
    b[u_, o_] := b[u, o] = If[u+o == 0, 1, Sum[b[o-1+j, u-j], {j, 1, u}]];
    T[n_, k_] := If[n == 0, 1, If[k == 0, 0, Function[l, Product[b[s, 0], {s, l}]*multinomial[n, l]][Table[Floor[(n+i)/k], {i, 0, k-1}]]]];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Nov 22 2023, after Alois P. Heinz *)
Showing 1-1 of 1 results.