login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A245988
Number of pairs of endofunctions f, g on [n] satisfying g^n(f(i)) = f(i) for all i in [n].
3
1, 1, 10, 141, 9592, 159245, 86252976, 908888155, 1682479423360, 128805405787953, 93998774487116800, 1099662085349496911, 44830846497021739693056, 147548082727234113659293, 3534565745374740945151080448, 1613371163531618738559582856125
OFFSET
0,3
LINKS
FORMULA
a(n) = A245980(n,n).
MAPLE
with(numtheory): with(combinat): M:=multinomial:
a:= proc(n) option remember; local l, g; l, g:= sort([divisors(n)[]]),
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; forget(g);
`if`(n=0, 1, add(g(j, n-j, nops(l), 0)*
stirling2(n, j)*binomial(n, j)*j!, j=0..n))
end:
seq(a(n), n=0..20);
MATHEMATICA
multinomial[n_, k_List] := n!/Times @@ (k!); M = multinomial;
b[n_, k0_, p_] := Module[{l, g}, l = Sort[Divisors[p]];
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]]]*
If[d - t == 1, g[k - (d - t)*j, m - t*j, i - 1, 0],
g[k - (d - t)*j, m - t*j, i, t + 1]], {j, 0, Min[k/(d - t),
If[t == 0, Infinity, m/t]]}]]]; g[k0, n - k0, Length[l], 0]];
A[n_, k_] := If[k == 0, n^(2*n), Sum[b[n, j, k]*StirlingS2[n, j]*Binomial[n, j]*j!, {j, 0, n}]];
A[0, _] = A[1, _] = 1;
a[n_] := A[n, n];
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Apr 29 2022, after Alois P. Heinz in A245980 *)
CROSSREFS
Main diagonal of A245980.
Cf. A245911.
Sequence in context: A343689 A277372 A181162 * A184710 A263055 A159327
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 08 2014
STATUS
approved