OFFSET
0,2
LINKS
Alois P. Heinz and Vaclav Kotesovec, Table of n, a(n) for n = 0..133 (terms 0..60 from Alois P. Heinz)
M. Kauers and C. Koutschan, Some D-finite and some possibly D-finite sequences in the OEIS, arXiv:2303.02793 [cs.SC], 2023.
FORMULA
a(n) ~ (phi - sqrt(phi)) * 2^(8*n-1/2) / (Pi^(3/2) * n^(5/2)), where phi = (1+sqrt(5))/2. - Vaclav Kotesovec, Jan 31 2015
EXAMPLE
a(0) = 1: the empty permutation.
a(1) = 7: (1,2,3,4), (1,2,4,3), (1,3,2,4), (1,4,2,3), (2,1,3,4), (2,1,4,3), (2,3,1,4).
a(2) = 403: (1,1,2,2,3,3,4,4), (1,1,2,2,3,4,3,4), ..., (2,3,2,3,1,1,4,4), (2,3,2,3,1,4,1,4).
MAPLE
b:= proc(l) option remember; local m, n, g;
m, n:= nops(l), add(i, i=l);
g:= add(i*l[i], i=1..m)-(m+1)/2*(n-1);
`if`(n<2, 1, add(`if`(l[i]>0 and i<=g,
b(subsop(i=l[i]-1, l)), 0), i=1..m))
end:
a:= n-> b([n$4]):
seq(a(n), n=0..15);
MATHEMATICA
b[l_] := b[l] = Module[{m, n, g}, {m, n} = {Length[l], Total[l]}; g = Sum[i*l[[i]], {i, 1, m}] - (m + 1)/2*(n - 1); If[n < 2, 1, Sum[If[l[[i]] > 0 && i <= g, b[ReplacePart[l, i -> l[[i]] - 1]], 0], {i, 1, m}]]];
a[k_] := b[Array[k&, 4]];
a /@ Range[0, 15] (* Jean-François Alcover, Dec 18 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 16 2012
STATUS
approved