OFFSET
0,5
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*f(n,k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1, f(n, k) = 2*k if k <= floor(n/2) otherwise 2*(n-k), and m = 2.
T(n, n-k, m) = T(n, k, m).
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 10, 1;
1, 39, 39, 1;
1, 128, 470, 128, 1;
1, 397, 3558, 3558, 397, 1;
1, 1206, 22387, 55452, 22387, 1206, 1;
1, 3635, 128377, 632343, 632343, 128377, 3635, 1;
1, 10924, 698788, 6107192, 12269406, 6107192, 698788, 10924, 1;
MATHEMATICA
f[n_, k_]:= If[k<=Floor[n/2], 2*k, 2*(n-k)];
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*f[n, k]*T[n-2, k-1, m]];
Table[T[n, k, 2], {n, 0, 12}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Feb 05 2022 *)
PROG
(Sage)
def f(n, k): return 2*k if (k <= n//2) else 2*(n-k)
@CachedFunction
def T(n, k, m): # A157277
if (k==0 or k==n): return 1
else: return (m*(n-k) +1)*T(n-1, k-1, m) + (m*k+1)*T(n-1, k, m) + m*f(n, k)*T(n-2, k-1, m)
flatten([[T(n, k, 2) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 05 2022
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 26 2009
EXTENSIONS
Edited by G. C. Greubel, Feb 05 2022
STATUS
approved