%I #30 Mar 07 2020 12:09:48
%S 1,0,1,0,2,1,0,10,10,1,0,100,140,28,1,0,1700,2900,840,60,1,0,44200,
%T 85800,31460,3300,110,1,0,1635400,3476200,1501500,203060,10010,182,1,
%U 0,81770000,185874000,90563200,14700400,943800,25480,280,1
%N Triangle read by rows, Lah numbers of order 2, T(n,n) = 1, T(n,k) = 0 if k<0 or k>n, otherwise T(n,k) = T(n-1,k-1)+((n-1)^2+k^2)*T(n-1,k), for n>=0 and 0<=k<=n.
%C 0
%H Peter Luschny, <a href="http://oeis.org/wiki/User:Peter_Luschny/P-Transform">The P-transform</a>.
%F T(n,k) = (-1)^k*((2*n)!/(2*k)!)*P[n,k](s(n)) where P is the P-transform and s(n) = ((n-1)^2+1)/(n*(4*n-2)). The P-transform is defined in the link. Compare also the Sage and Maple implementations below.
%F T(n,k) = Sum_{j=k..n} A269944(n,j)*A269945(j,k).
%F T(n,1) = Product_{k=1..n} (k-1)^2+1 for n>=1 (cf. A101686).
%F T(n,n-1) = (n-1)*n*(2*n-1)/3 for n>=1 (cf. A006331).
%F Row sums: A269938.
%e [1]
%e [0, 1]
%e [0, 2, 1]
%e [0, 10, 10, 1]
%e [0, 100, 140, 28, 1]
%e [0, 1700, 2900, 840, 60, 1]
%e [0, 44200, 85800, 31460, 3300, 110, 1]
%e [0, 1635400, 3476200, 1501500, 203060, 10010, 182, 1]
%p T := proc(n,k) option remember;
%p if n=k then return 1 fi; if k<0 or k>n then return 0 fi;
%p T(n-1,k-1)+((n-1)^2+k^2)*T(n-1,k) end:
%p seq(seq(T(n,k), k=0..n), n=0..8);
%p # Alternatively with the P-transform (cf. A269941):
%p A268434_row := n -> PTrans(n, n->`if`(n=1,1, ((n-1)^2+1)/(n*(4*n-2))),
%p (n,k)->(-1)^k*(2*n)!/(2*k)!): seq(print(A268434_row(n)), n=0..8);
%t T[n_, n_] = 1; T[_, 0] = 0; T[n_, k_] /; 0 < k < n := T[n, k] = T[n-1, k-1] + ((n-1)^2 + k^2)*T[n-1, k]; T[_, _] = 0;
%t Table[T[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Jun 20 2017 *)
%o (Sage)
%o #cached_function
%o def T(n, k):
%o if n==k: return 1
%o if k<0 or k>n: return 0
%o return T(n-1, k-1)+((n-1)^2+k^2)*T(n-1, k)
%o for n in range(8): print([T(n, k) for k in (0..n)])
%o # Alternatively with the function PtransMatrix (cf. A269941):
%o PtransMatrix(8, lambda n: 1 if n==1 else ((n-1)^2+1)/(n*(4*n-2)), lambda n, k: (-1)^k*factorial(2*n)/factorial(2*k))
%Y Cf. A038207 (order 0), A111596 (order 1), A269946 (order 3).
%Y Cf. A036969, A105278, A204579, A269938, A269941, A269944, A269945.
%K nonn,tabl
%O 0,5
%A _Peter Luschny_, Mar 07 2016
|