OFFSET
1,5
COMMENTS
LINKS
Alois P. Heinz, Rows n = 1..18, flattened
FORMULA
Sum_{k=0..n-1} k * T(n,k) = A018927(n). - Alois P. Heinz, Feb 21 2019
EXAMPLE
T(4,2) = 6 because we have 1324, 4132, 2413, 4213, 2431, and 3241.
Triangle starts:
1;
1, 1;
1, 3, 2;
1, 13, 6, 4;
1, 67, 30, 14, 8;
...
MAPLE
with(combinat): minasc := proc (p) local j, b: for j to nops(p)-1 do if 0 < p[j+1]-p[j] then b[j] := p[j+1]-p[j] else b[j] := infinity end if end do: if min(seq(b[j], j = 1 .. nops(p)-1)) = infinity then 0 else min(seq(b[j], j = 1 .. nops(p)-1)) end if end proc; for n to 10 do P := permute(n): f[n] := sort(add(t^minasc(P[j]), j = 1 .. factorial(n))) end do: for n to 10 do seq(coeff(f[n], t, i), i = 0 .. n-1) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(s, l, m) option remember; `if`(s={}, x^`if`(m=infinity, 0, m),
add(b(s minus {j}, j, `if`(j<l, m, min(m, j-l))), j=s))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(b({$1..n}, infinity$2)):
seq(T(n), n=1..10); # Alois P. Heinz, Feb 21 2019
MATHEMATICA
b[s_List, l_, m_] := b[s, l, m] = If[s == {}, x^If[m == Infinity, 0, m], Sum[b[s ~Complement~ {j}, j, If[j < l, m, Min[m, j - l]]], {j, s}]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n - 1}]][b[ Range[n], Infinity, Infinity]];
T /@ Range[10] // Flatten (* Jean-François Alcover, Dec 08 2019, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Sep 07 2010
STATUS
approved