OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..450
Wikipedia, Permutation
FORMULA
MAPLE
b:= proc(n, g) option remember; `if`(n=0, x^g, add((j-1)!
*b(n-j, ilcm(g, j))*binomial(n-1, j-1), j=1..n))
end:
a:= n-> (p-> add(coeff(p, x, i*n), i=1..degree(p)/n))(b(n, 1)):
seq(a(n), n=1..23);
# second Maple program:
h:= proc(n, j) option remember; uses padic, numtheory; n/mul(`if`(
ordp(j, p)<ordp(n, p), 1, p^ordp(n, p)), p=factorset(igcd(n, j)))
end:
b:= proc(n, m) option remember; `if`(n=0, `if`(m=1, 1, 0),
add((j-1)!*b(n-j, h(m, j))*binomial(n-1, j-1), j=1..n))
end:
a:= n-> b(n$2):
seq(a(n), n=1..23);
MATHEMATICA
b[n_, g_] := b[n, g] = If[n == 0, x^g, Sum[(j - 1)!*b[n - j, LCM[g, j]]* Binomial[n - 1, j - 1], {j, 1, n}]] // Expand;
a[n_] := With[{p = b[n, 1]}, Sum[Coefficient[p, x, i*n], {i, 1, Exponent[p, x]/n}]];
Array[a, 40] (* Jean-François Alcover, Aug 23 2021, after Alois P. Heinz's first program *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 05 2021
STATUS
approved