# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a242027 Showing 1-1 of 1 %I A242027 #20 Feb 18 2017 10:56:01 %S A242027 1,0,1,0,4,0,24,3,0,206,50,0,2300,825,0,31742,14794,120,0,522466, %T A242027 294987,6090,0,9996478,6547946,232792,0,218088504,160994565,8337420,0, %U A242027 5344652492,4355845868,299350440,151200,0,145386399554,128831993037,11074483860,18794160 %N A242027 Number T(n,k) of endofunctions on [n] with cycles of k distinct lengths; triangle T(n,k), n>=0, 0<=k<=A003056(n), read by rows. %H A242027 Alois P. Heinz, Rows n = 0..140, flattened %e A242027 T(3,2) = 3: (1,3,2), (3,2,1), (2,1,3). %e A242027 Triangle T(n,k) begins: %e A242027 00 : 1; %e A242027 01 : 0, 1; %e A242027 02 : 0, 4; %e A242027 03 : 0, 24, 3; %e A242027 04 : 0, 206, 50; %e A242027 05 : 0, 2300, 825; %e A242027 06 : 0, 31742, 14794, 120; %e A242027 07 : 0, 522466, 294987, 6090; %e A242027 08 : 0, 9996478, 6547946, 232792; %e A242027 09 : 0, 218088504, 160994565, 8337420; %e A242027 10 : 0, 5344652492, 4355845868, 299350440, 151200; %p A242027 with(combinat): %p A242027 b:= proc(n, i, k) option remember; `if`(n=0, `if`(k=0, 1, 0), %p A242027 `if`(i<1 or k<1, 0, add((i-1)!^j*multinomial(n, n-i*j, i$j)/j!* %p A242027 b(n-i*j, i-1, k-`if`(j=0, 0, 1)), j=0..n/i))) %p A242027 end: %p A242027 T:= (n, k)-> add(binomial(n-1, j-1)*n^(n-j)*b(j$2, k), j=0..n): %p A242027 seq(seq(T(n, k), k=0..floor((sqrt(1+8*n)-1)/2)), n=0..14); %t A242027 multinomial[n_, k_] := n!/Times @@ (k!); b[n_, i_, k_] := b[n, i, k] = If[n == 0, If[k==0, 1, 0], If[i<1 || k<1, 0, Sum[(i-1)!^j*multinomial[n, Join[ {n-i*j}, Array[i&, j]]]/j!*b[n-i*j, i-1, k-If[j==0, 0, 1]], {j, 0, n/i}]] ]; T[0, 0] = 1; T[n_, k_] := Sum[Binomial[n-1, j-1]*n^(n-j)*b[j, j, k], {j, 0, n}]; Table[T[n, k], {n, 0, 14}, {k, 0, Floor[(Sqrt[1+8n]-1)/2]}] // Flatten (* _Jean-François Alcover_, Feb 18 2017, translated from Maple *) %Y A242027 Columns k=0-10 give: A000007, A241980 for n>0, A246283, A246284, A246285, A246286, A246287, A246288, A246289, A246290, A246291. %Y A242027 Row sums give A000312. %Y A242027 T(A000217(n),n) gives A246292. %Y A242027 Cf. A003056, A060281, A218868 (the same for permutations). %K A242027 nonn,tabf %O A242027 0,5 %A A242027 _Alois P. Heinz_, Aug 11 2014 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE