OFFSET
1,2
COMMENTS
LINKS
Clark Kimberling, Antidiagonals n = 1..60, flattened
FORMULA
T(n,k) = 5*T(n,k-1) - 9*T(n,k-2) + 7*T(n,k-3) - 2*T(n,k-4).
G.f. for row n: f(x)/g(x), where f(x) = n - (n-1)*x and g(x) = (1-2*x) *(1-x)^3.
T(n,k) = 2*(n+1)*(2^k - 1) - k*(k + 2*n + 3)/2. - G. C. Greubel, Jul 08 2019
EXAMPLE
Northwest corner (the array is read by falling antidiagonals):
1...5....16...42....99....219
2...9....27...68....156...339
3...13...38...94....213...459
4...17...49...120...270...579
5...21...60...146...327...699
6...25...71...172...384...819
MATHEMATICA
(* First program *)
b[n_]:= 2^n - 1; c[n_]:= n;
T[n_, k_]:= Sum[b[k-i] c[n+i], {i, 0, k-1}]
TableForm[Table[T[n, k], {n, 1, 10}, {k, 1, 10}]]
Flatten[Table[T[n-k+1, k], {n, 12}, {k, n, 1, -1}]] (* A213582 *)
r[n_]:= Table[T[n, k], {k, 40}]
Table[T[n, n], {n, 1, 40}] (* A213583 *)
s[n_]:= Sum[T[i, n+1-i], {i, 1, n}]
Table[s[n], {n, 1, 50}] (* A156928 *)
(* Second program *)
Table[2*(k+1)*(2^(n-k+1) -1) -(n-k+1)*(n+k+4)/2, {n, 12}, {k, n}]//Flatten (* G. C. Greubel, Jul 08 2019 *)
PROG
(PARI) t(n, k) = 2*(k+1)*(2^(n-k+1) -1) -(n-k+1)*(n+k+4)/2;
for(n=1, 12, for(k=1, n, print1(t(n, k), ", "))) \\ G. C. Greubel, Jul 08 2019
(Magma) [[2*(k+1)*(2^(n-k+1) -1) -(n-k+1)*(n+k+4)/2: k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jul 08 2019
(Sage) [[2*(k+1)*(2^(n-k+1) -1) -(n-k+1)*(n+k+4)/2 for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jul 08 2019
(GAP) Flat(List([1..12], n-> List([1..n], k-> 2*(k+1)*(2^(n-k+1) -1) -(n-k+1)*(n+k+4)/2 ))) # G. C. Greubel, Jul 08 2019
CROSSREFS
KEYWORD
AUTHOR
Clark Kimberling, Jun 19 2012
STATUS
approved