login
Number of endofunctions on [n] whose cycle lengths are squares.
5

%I #10 Jun 06 2018 03:50:06

%S 1,1,3,16,131,1446,19957,329344,6315129,137942380,3382214291,

%T 92014156224,2751300514987,89701699067176,3167429783609925,

%U 120428877629249536,4905431165356442993,213120603686615692176,9837426739843075654819,480775495859934668704000

%N Number of endofunctions on [n] whose cycle lengths are squares.

%H Alois P. Heinz, <a href="/A273997/b273997.txt">Table of n, a(n) for n = 0..386</a>

%p b:= proc(n) option remember; local r, f, g;

%p if n=0 then 1 else r, f, g:=0, 1, 3;

%p while f<=n do r:= r+(f-1)!*b(n-f)*

%p binomial(n-1, f-1); f, g:= f+g, g+2

%p od; r fi

%p end:

%p a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):

%p seq(a(n), n=0..20);

%t b[n_] := b[n] = Module[{r, f, g}, If[n == 0, 1, {r, f, g} = {0, 1, 3}; While[f <= n, r = r + (f - 1)!*b[n - f]*Binomial[n - 1, f - 1]; {f, g} = {f + g, g + 2}]; r]];

%t a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];

%t Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, Jun 06 2018, from Maple *)

%Y Cf. A000290, A060435, A116956, A205801, A273994, A273996, A273998.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Jun 06 2016