# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a157147 Showing 1-1 of 1 %I A157147 #10 Jan 10 2022 03:06:46 %S A157147 1,1,1,1,5,1,1,15,15,1,1,37,110,37,1,1,83,568,568,83,1,1,177,2415, %T A157147 5534,2415,177,1,1,367,9137,41027,41027,9137,367,1,1,749,32104,255155, %U A157147 498814,255155,32104,749,1,1,1515,107442,1409814,4845540,4845540,1409814,107442,1515,1 %N A157147 Triangle T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*k*(n-k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1 and m = 1, read by rows. %H A157147 G. C. Greubel, Rows n = 0..50 of the triangle, flattened %F A157147 T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*k*(n-k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1 and m = 1. %F A157147 T(n, n-k) = T(n, k). %e A157147 1; %e A157147 1, 1; %e A157147 1, 5, 1; %e A157147 1, 15, 15, 1; %e A157147 1, 37, 110, 37, 1; %e A157147 1, 83, 568, 568, 83, 1; %e A157147 1, 177, 2415, 5534, 2415, 177, 1; %e A157147 1, 367, 9137, 41027, 41027, 9137, 367, 1; %e A157147 1, 749, 32104, 255155, 498814, 255155, 32104, 749, 1; %e A157147 1, 1515, 107442, 1409814, 4845540, 4845540, 1409814, 107442, 1515, 1; %p A157147 A157147:= proc(n,k) %p A157147 option remember; %p A157147 if k < 0 or k> n then 0; %p A157147 elif k = 0 or k = n then 1; %p A157147 else (n-k+1)*procname(n-1,k-1) +(k+1)*procname(n-1,k) +k*(n-k)*procname(n-2,k-1); %p A157147 end if; %p A157147 end proc: %p A157147 seq(seq(A157147(n,k),k=0..n),n=0..10); # _R. J. Mathar_, Feb 06 2015 %t A157147 T[n_, k_, m_]:= T[n,k,m]= If[k==0 || k==n, 1, (m*(n-k)+1)*T[n-1, k-1, m] + (m*k+1)*T[n-1, k, m] + m*k*(n-k)*T[n-2, k-1, m]]; %t A157147 Table[T[n,k,1], {n,0,10}, {k,0,n}]//Flatten (* modified by _G. C. Greubel_, Jan 09 2022 *) %o A157147 (Sage) %o A157147 def T(n,k,m): # A157147 %o A157147 if (k==0 or k==n): return 1 %o A157147 else: return (m*(n-k) +1)*T(n-1,k-1,m) + (m*k+1)*T(n-1,k,m) + m*k*(n-k)*T(n-2,k-1,m) %o A157147 flatten([[T(n,k,1) for k in (0..n)] for n in (0..10)]) # _G. C. Greubel_, Jan 09 2022 %Y A157147 Cf. A007318 (m=0), A157147 (m=1), A157148 (m=2), A157149 (m=3), A157150 (m=4), A157151 (m=5). %Y A157147 Cf. A157152, A157153, A157154, A157155, A157156, A157207, A157208, A157209, A157210, A157211, A157212, A157268, A157272, A157273, A157274, A157275. %K A157147 nonn,tabl,easy %O A157147 0,5 %A A157147 _Roger L. Bagula_, Feb 24 2009 %E A157147 Edited by _G. C. Greubel_, Jan 09 2022 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE