%I #46 Jan 14 2022 11:48:24
%S 1,1,5,49,821,21121,775205,38516689,2490976661,203419086241,
%T 20474978755205,2490729330118129,360263844701062901,
%U 61114158974786823361,12017074366801186956005,2711409826920884006692369,695820350706240448128979541,201526362605605903609254528481
%N Stirling transform of (n!)^2.
%C From _Thomas Wieder_, Oct 21 2004: (Start)
%C "Also the number of hierarchies with labeled elements and labeled levels where the levels are permuted. Let l_x denote level x, e.g. l_2 is level 2. Let 1 denote an element and 2 a second element and so on. Then l_1:123 means elements 1,2 and 3 are on level 1.
%C "Let | indicate separation between levels. Then l_1:1|l_2:346|l_3:5 denotes a hierarchy of n=6 unlabeled elements with element 1 on level 1, elements 3,4 and 6 on level 2 and element 5 on level 3.
%C "E.g. for n=3 one has a(3) = 49 possible hierarchies:
%C "l_1:123,
%C "l_1:12|l_2:3, l_1:13|l_2:2, l_1:23|l_2:1,
%C "l_2:12|l_1:3, l_2:13|l_1:2, l_2:23|l_1:1,
%C "l_1:1|l_2:23, l_1:2|l_2:13, l_1:3|l_2:12,
%C "l_2:1|l_1:23, l_2:2|l_1:13, l_2:3|l_1:12,
%C "l_1:1|l_2:2|l_3:3 and further five permutations of the elements with levels fixed,
%C "l_3:1|l_1:2|l_2:3 and further five permutations of the elements with levels fixed,. etc., up to
%C "l_3:1|l_2:2|l_1:3 and further five permutations of the elements with levels fixed. this gives 1 + 6 +6 + 6*6 = 49 = a(3) possible hierarchies.
%C "See A001339 for the number of hierarchies with unlabeled elements and labeled levels."
%C (End)
%C Conjecture: for fixed k = 1,2,..., the sequence a(n) (mod k) is eventually periodic with the exact period dividing phi(k), where phi(k) is the Euler totient function A000010. For example, modulo 10 the sequence becomes (1, 1, 5, 9, 1, 1, 5, 9, ...), with an apparent period 1, 1, 5, 9 of length 4 = phi(10) beginning at a(0). - _Peter Bala_, Jan 15 2018
%H Alois P. Heinz, <a href="/A064618/b064618.txt">Table of n, a(n) for n = 0..253</a>
%F a(n) = Sum_{k=0..n} Stirling2(n, k)*(k!)^2.
%F E.g.f: hypergeom([1, 1], [], exp(x)-1). - _Vladeta Jovovic_, Sep 14 2003
%F O.g.f.: Sum_{n>=0} n!^2 * Product_{k=1..n} x/(1 - k*x). - _Paul D. Hanna_, Nov 25 2012
%F a(n) ~ exp(1/2) * (n!)^2. - _Vaclav Kotesovec_, May 10 2014
%p a:= n-> add(Stirling2(n, k)*(k!^2), k=0..n):
%p seq(a(n), n=0..20); # _Alois P. Heinz_, Apr 21 2012
%t Table[Sum[(k!)^2*StirlingS2[n, k], {k, 0, n}], {n, 0, 20}] (* _Vaclav Kotesovec_, May 10 2014 *)
%o (PARI) /* By Vladeta Jovovic's formula: */
%o {a(n) = my(X=x+x*O(x^n)); n!*polcoeff( sum(m=0,n, m!*(exp(X)-1)^m), n)} /* _Paul D. Hanna_, Feb 15 2012 */
%Y Cf. A001044.
%Y Cf. A001339.
%Y Cf. A242282, A242283, A019774, A320502.
%K nonn,easy
%O 0,3
%A _Karol A. Penson_, Sep 26 2001