%I #36 Nov 15 2023 07:43:25
%S 1,1,1,3,8,36,174,1104,7440,62640,545040,5649840,60681600,748621440,
%T 9518342400,136758585600,2009451628800,32848492723200,549241915622400,
%U 10066913176320000,188293339922688000,3832031198451456000,79291640831090688000,1771146970953744384000
%N Number of permutations of [n] such that each cycle contains its length as an element.
%C The cycle lengths are distinct as a consequence of the definition.
%H Alois P. Heinz, <a href="/A362362/b362362.txt">Table of n, a(n) for n = 0..450</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation">Permutation</a>
%e a(3) = 3: (123), (132), (1)(23).
%e a(4) = 8: (1234), (1243), (1324), (1342), (1423), (1432), (1)(234), (1)(243).
%p a:= n-> add((n-nops(p))!, p=select(l-> nops(l)=
%p nops({l[]}), combinat[partition](n))):
%p seq(a(n), n=0..24);
%p # second Maple program:
%p b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0,
%p `if`(n=0, p!, b(n, i-1, p)+b(n-i, min(n-i, i-1), p-1)))
%p end:
%p a:= n-> b(n$3):
%p seq(a(n), n=0..24);
%t b[n_, i_, p_] := b[n, i, p] = If[i*(i + 1)/2 < n, 0, If[n == 0, p!, b[n, i - 1, p] + b[n - i, Min[n - i, i - 1], p - 1]]];
%t a[n_] := b[n, n, n];
%t Table[a[n], {n, 0, 24}] (* _Jean-François Alcover_, Nov 15 2023, from second Maple program *)
%Y Cf. A000009, A007838, A032020, A179973, A321520, A326493, A364277, A364406.
%K nonn
%O 0,4
%A _Alois P. Heinz_, Jul 05 2023