%I #25 Apr 12 2019 14:13:41
%S 1,1,1,1,6,1,1,27,21,1,1,112,270,58,1,1,453,2878,1738,141,1,1,1818,
%T 28167,39320,8739,318,1,1,7279,264411,769955,375755,37665,685,1,1,
%U 29124,2430652,13905746,13243650,2858960,146560,1434,1,1,116505,22108860
%N Triangle T(n, k) read by rows: T(n, k)= (m*n-m*k+1)*T(n-1, k-1) + k*(m*k-(m-1))*T(n-1, k) where m = 1.
%C The general recursion relation T(n,k)= (m*n - m*k + 1)*T(n - 1, k - 1) + k*(m*k - (m - 1))*T(n - 1, k) connects several sequences for differing values of m. These are: m = 0 yields A008277, m = 1 yields this sequence, m = 2 yields A166961, and m = 3 yields A166962. These sequences are, in essence, generalized Stirling numbers of the second kind. - _G. C. Greubel_, May 29 2016
%H G. C. Greubel, <a href="/A166960/b166960.txt">Table of n, a(n) for the first 25 rows</a>
%F T(n, k) = (n-k+1)*T(n-1, k-1) + k^2*T(n-1, k).
%e Triangle starts:
%e {1},
%e {1, 1},
%e {1, 6, 1},
%e {1, 27, 21, 1},
%e {1, 112, 270, 58, 1},
%e {1, 453, 2878, 1738, 141, 1},
%e {1, 1818, 28167, 39320, 8739, 318, 1},
%e {1, 7279, 264411, 769955, 375755, 37665, 685, 1},
%e {1, 29124, 2430652, 13905746, 13243650, 2858960, 146560, 1434, 1},
%e {1, 116505, 22108860, 239506500, 414525726, 169140810, 18617280, 531456, 2949, 1}
%e ...
%t A[n_, 1] := 1; A[n_, n_] := 1; A[n_, k_] := (n - k + 1)*A[n - 1, k - 1] + k^2*A[n - 1, k]; Flatten[Table[A[n, k], {n, 10}, {k, n}]] (* modified by _G. C. Greubel_, May 29 2016 *)
%t T[ n_, k_] := Which[k < 1 || k > n, 0, 1 == k == n, 1, True, T[n, k] = k^2 T[n - 1, k] + (n - k + 1) T[n - 1, k - 1]]; (* _Michael Somos_, Apr 12 2019 *)
%Y Cf. A008277, A166961, A166962.
%K nonn,tabl
%O 1,5
%A _Roger L. Bagula_, Oct 25 2009