A142458 Triangle T(n,k) read by rows: T(n,k) = 1 if k=1 or k=n, otherwise T(n,k) = (3*n-3*k+1)*T(n-1,k-1) + (3*k-2)*T(n-1,k).
1, 1, 1, 1, 8, 1, 1, 39, 39, 1, 1, 166, 546, 166, 1, 1, 677, 5482, 5482, 677, 1, 1, 2724, 47175, 109640, 47175, 2724, 1, 1, 10915, 373809, 1709675, 1709675, 373809, 10915, 1, 1, 43682, 2824048, 23077694, 44451550, 23077694, 2824048, 43682, 1
Offset: 1
Examples
The rows n >= 1 and columns 1 <= k <= n look as follows: 1; 1, 1; 1, 8, 1; 1, 39, 39, 1; 1, 166, 546, 166, 1; 1, 677, 5482, 5482, 677, 1; 1, 2724, 47175, 109640, 47175, 2724, 1; 1, 10915, 373809, 1709675, 1709675, 373809, 10915, 1; 1, 43682, 2824048, 23077694, 44451550, 23077694, 2824048, 43682, 1;
Links
- G. C. Greubel, Rows n = 1..50 of the triangle, flattened
- G. Strasser, Generalisation of the Euler adic, Math. Proc. Camb. Phil. Soc. 150 (2010) 241-256, Triangle A_3(n,k).
Crossrefs
Programs
-
Maple
A142458 := proc(n,k) if n = k then 1; elif k > n or k < 1 then 0 ;else (3*n-3*k+1)*procname(n-1,k-1)+(3*k-2)*procname(n-1,k) ; end if; end proc: seq(seq(A142458(n,k),k=1..n),n=1..10) ; # R. J. Mathar, Jun 04 2011
-
Mathematica
T[n_, k_, m_]:= T[n, k, m]= If[k==1 || k==n, 1, (m*n-m*k+1)*T[n-1, k-1, m] + (m*k -m+1)*T[n-1, k, m] ]; Table[T[n, k, 3], {n, 1, 10}, {k, 1, n}]//Flatten (* modified by G. C. Greubel, Mar 14 2022 *)
-
Sage
def T(n,k,m): # A142458 if (k==1 or k==n): return 1 else: return (m*(n-k)+1)*T(n-1,k-1,m) + (m*k-m+1)*T(n-1,k,m) flatten([[T(n,k,3) for k in (1..n)] for n in (1..10)]) # G. C. Greubel, Mar 14 2022
Formula
Extensions
Edited by the Associate Editors of the OEIS, Aug 28 2009
Comments