[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A157209
Triangle 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) = k if k <= floor(n/2) otherwise n-k, and m = 3, read by rows.
23
1, 1, 1, 1, 11, 1, 1, 54, 54, 1, 1, 229, 822, 229, 1, 1, 932, 8368, 8368, 932, 1, 1, 3747, 72066, 174758, 72066, 3747, 1, 1, 15010, 570006, 2759750, 2759750, 570006, 15010, 1, 1, 60065, 4297714, 37366190, 73850596, 37366190, 4297714, 60065, 1, 1, 240288, 31495488, 460448520, 1591033788, 1591033788, 460448520, 31495488, 240288, 1
OFFSET
0,5
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) = k if k <= floor(n/2) otherwise n-k, and m = 3.
T(n, n-k, m) = T(n, k, m).
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 11, 1;
1, 54, 54, 1;
1, 229, 822, 229, 1;
1, 932, 8368, 8368, 932, 1;
1, 3747, 72066, 174758, 72066, 3747, 1;
1, 15010, 570006, 2759750, 2759750, 570006, 15010, 1;
1, 60065, 4297714, 37366190, 73850596, 37366190, 4297714, 60065, 1;
MATHEMATICA
f[n_, k_]:= If[k<=Floor[n/2], k, 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, 3], {n, 0, 10}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Jan 10 2022 *)
PROG
(Sage)
def f(n, k): return k if (k <= n//2) else n-k
@CachedFunction
def T(n, k, m): # A157209
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, 3) for k in (0..n)] for n in (0..20)]) # G. C. Greubel, Jan 10 2022
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 25 2009
EXTENSIONS
Edited by G. C. Greubel, Jan 10 2022
STATUS
approved