OFFSET
1,5
LINKS
Alois P. Heinz, Rows n = 1..142, flattened
Wikipedia, Permutation
FORMULA
EXAMPLE
The 6 permutations p of [3]: 123, 132, 213, 231, 312, 321 have (signed) displacement sets {p(i)-i, i=1..3}: {0}, {-1,0,1}, {-1,0,1}, {-2,1}, {-1,2}, {-2,0,2}, respectively. Numbers -2 and 2 occur twice, -1 and 1 occur thrice, and 0 occurs four times. So row n=3 is [2, 3, 4, 3, 2].
Triangle T(n,k) begins:
: 1 ;
: 1, 1, 1 ;
: 2, 3, 4, 3, 2 ;
: 6, 10, 13, 15, 13, 10, 6 ;
: 24, 42, 56, 67, 76, 67, 56, 42, 24 ;
: 120, 216, 294, 358, 411, 455, 411, 358, 294, 216, 120 ;
MAPLE
b:= proc(s, d) option remember; (n-> `if`(n=0, add(x^j, j=d),
add(b(s minus {i}, d union {n-i}), i=s)))(nops(s))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1-n..n-1))(b({$1..n}, {})):
seq(T(n), n=1..8);
# second Maple program:
T:= (n, k)-> -add((-1)^j*binomial(n-abs(k), j)*(n-j)!, j=1..n):
seq(seq(T(n, k), k=1-n..n-1), n=1..9);
MATHEMATICA
T[n_, k_] := -Sum[(-1)^j Binomial[n-Abs[k], j] (n-j)!, {j, 1, n}];
Table[Table[T[n, k], {k, 1-n, n-1}], {n, 1, 9}] // Flatten (* Jean-François Alcover, Feb 20 2021, after Alois P. Heinz *)
KEYWORD
nonn,tabf
AUTHOR
Alois P. Heinz, Feb 17 2019
STATUS
approved