login
A157118
Triangle T(n, k) = f(n, k) + f(n, n-k), where f(n, k) = A001263(n*k+1, n-k+1) if k <= n otherwise A001263(n*(n-k)+1, k+1) and T(1, k) = 1, read by rows.
2
2, 1, 1, 1, 6, 1, 1, 27, 27, 1, 1, 88, 672, 88, 1, 1, 225, 9150, 9150, 225, 1, 1, 486, 98385, 395352, 98385, 486, 1, 1, 931, 1126951, 11748681, 11748681, 1126951, 931, 1, 1, 1632, 14600320, 402703120, 588593280, 402703120, 14600320, 1632, 1, 1, 2673, 201755880, 16093941435, 32251030119, 32251030119, 16093941435, 201755880, 2673, 1
OFFSET
0,1
FORMULA
T(n, k) = f(n, k) + f(n, n-k), where f(n, k) = A001263(n*k+1, n-k+1) if k <= n otherwise A001263(n*(n-k)+1, k+1) and T(1, k) = 1.
T(n, n-k) = T(n, k).
EXAMPLE
Triangle begins as:
2;
1, 1;
1, 6, 1;
1, 27, 27, 1;
1, 88, 672, 88, 1;
1, 225, 9150, 9150, 225, 1;
1, 486, 98385, 395352, 98385, 486, 1;
1, 931, 1126951, 11748681, 11748681, 1126951, 931, 1;
1, 1632, 14600320, 402703120, 588593280, 402703120, 14600320, 1632, 1;
MATHEMATICA
A001263[n_, k_]:= Binomial[n-1, k-1]*Binomial[n, k]/(n-k+1);
f[n_, k_]:= If[k<=n, A001263[n*k+1, n-k+1], A001263[n*(n-k)+1, k+1]];
T[n_, k_]:= If[n==1, 1, f[n, k] + f[n, n-k]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Jan 11 2022 *)
PROG
(Magma)
A001263:= func< n, k | Binomial(n-1, k-1)*Binomial(n, k)/(n-k+1) >;
f:= func< n, k | k le n select A001263(n*k+1, n-k+1) else A001263(n*(n-k)+1, k+1) >;
A157118:= func< n, k | n eq 1 select 1 else f(n, k) + f(n, n-k) >;
[A157118(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 11 2022
(Sage)
def A001263(n, k): return binomial(n-1, k-1)*binomial(n, k)/(n-k+1)
def f(n, k): return A001263(n*k+1, n-k+1) if (k<n+1) else A001263(n*(n-k)+1, k+1)
def A157118(n, k): return 1 if (n==1) else f(n, k) + f(n, n-k)
flatten([[A157118(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jan 11 2022
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 23 2009
EXTENSIONS
Edited by G. C. Greubel, Jan 11 2022
STATUS
approved