A316294 Total number of permutations p of [k] such that n is the maximum of the partial sums of the signed up-down jump sequence of 0,p summed over all k >= 0.
1, 1, 3, 19, 258, 7406, 442668, 54371100, 13585980916, 6859762797636, 6969135518632452, 14209819222900305044, 58061006907633910998660, 474996314819118381967232244, 7776635831062534849079443379908, 254723669580125156112963535996038036
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..40
Programs
-
Maple
b:= proc(u, o, c, k) option remember; `if`(c>k, 0, `if`(u+o=0, 1, add(b(u-j, o-1+j, c+j, k), j=1..u)+ add(b(u+j-1, o-j, c-j, k), j=1..o))) end: a:= n-> add(b(k, 0$2, n)-b(k, 0$2, n-1), k=n..n*(n+1)/2): seq(a(n), n=0..15);
-
Mathematica
b[u_, o_, c_, k_] := b[u, o, c, k] = If[c > k, 0, If[u + o == 0, 1, Sum[b[u - j, o - 1 + j, c + j, k], {j, u}] + Sum[b[u + j - 1, o - j, c - j, k], {j, o}]]]; a[n_] := Sum[b[k, 0, 0, n] - b[k, 0, 0, n-1], {k, n, n(n+1)/2}]; Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Sep 01 2021, after Alois P. Heinz *)
Comments