login
A241015
Number of pairs of endofunctions f, g on [n] satisfying g(g(g(f(i)))) = f(i) for all i in [n].
5
1, 1, 6, 141, 6184, 387545, 33404256, 3891981205, 592320594048, 113184611671473, 26327424526220800, 7302855260707822541, 2381136881374877847552, 901709366369630531857417, 392234247731566637785780224, 194028806625479344354551301125
OFFSET
0,3
LINKS
FORMULA
a(n) = Sum_{k=0..n} C(n,k) * A048993(n,k) * k! * A245958(n,k).
MAPLE
with(combinat): M:=multinomial:
b:= proc(n, k) local l, g; l, g:= [1, 3],
proc(k, m, i, t) option remember; local d, j; d:= l[i];
`if`(i=1, n^m, add(M(k, k-(d-t)*j, (d-t)$j)/j!*
(d-1)!^j *M(m, m-t*j, t$j) *g(k-(d-t)*j, m-t*j,
`if`(d-t=1, [i-1, 0], [i, t+1])[]), j=0..min(k/(d-t),
`if`(t=0, [][], m/t))))
end; g(k, n-k, nops(l), 0)
end:
a:= n-> add(b(n, j)*stirling2(n, j)*binomial(n, j)*j!, j=0..n):
seq(a(n), n=0..20);
MATHEMATICA
multinomial[n_, k_] := n!/Times @@ (k!); M = multinomial; b[n_, k0_] := Module[{l, g}, l = {1, 3}; g[k_, m_, i_, t_] := g[k, m, i, t] = Module[{d, j}, d = l[[i]]; If[i==1, n^m, Sum[M[k, Join[{k-(d-t)*j}, Array[d-t&, j]]]/j!*(d-1)!^j *M[m, Join[{m-t*j}, Array[t&, j]]]*g[k-(d-t)*j, m-t*j, Sequence @@ If[d-t==1, {i-1, 0}, {i, t+1}]], {j, 0, Min[k/(d-t), If[t==0, Infinity, m/t]]}]]]; g[k0, n-k0, Length[l], 0]]; a[0] = 1; a[n_] := Sum[b[n, j]*StirlingS2[n, j]*Binomial[n, j]*j!, {j, 0, n}]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Mar 13 2017, translated from Maple *)
CROSSREFS
Column k=3 of A245980.
Sequence in context: A078450 A193502 A059488 * A245986 A225810 A067196
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 07 2014
STATUS
approved