OFFSET
0,5
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..2507 (rows 0..200)
MathOverflow, Why 'excedances' of permutations? [closed].
EXAMPLE
Triangle begins:
1
1
1 1
2 2
3 5
6 9 1
11 18 3
21 35 8
41 67 20
80 131 44 1
157 257 94 4
310 505 197 12
614 996 406 32
For example, row n = 5 counts the following compositions:
(113) (5) (23)
(122) (14)
(1112) (32)
(1121) (41)
(1211) (131)
(11111) (212)
(221)
(311)
(2111)
MATHEMATICA
pd[y_]:=Length[Select[Range[Length[y]], #<y[[#]]&]];
DeleteCases[Table[Length[Select[Join@@ Permutations/@IntegerPartitions[n], pd[#]==k&]], {n, 0, 10}, {k, 0, n}], 0, {2}]
PROG
(PARI)
S(v, u)={vector(#v, k, sum(i=1, k-1, v[k-i]*u[i]))}
T(n)={my(v=vector(1+n), s); v[1]=1; s=v; for(i=1, n, v=S(v, vector(n, j, if(j>i, 'x, 1))); s+=v); [Vecrev(p) | p<-s]}
{ my(A=T(12)); for(n=1, #A, print(A[n])) } \\ Andrew Howroyd, Jan 02 2023
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Gus Wiseman, Mar 22 2022
STATUS
approved