OFFSET
1,4
FORMULA
O.g.f.: (2*x^3*y^2 + y^2*(1 + y) + x^2*(y - 3*y^2) - x*(-1 + 2*y + y^2))/((1 - x)^3*(1 + x) *(1 - y)^3*(1 + y)).
E.g.f.: exp(-x-y)*(exp(2*x) + 2*exp(2*(x+y))*(x*(3 + x) - 2*x*y + 2*y^2 - 1))/8.
T(n, k) = (-1)^k + (-1)^(n-k+1) + 4*k^2 + 4*n + 2*n^2 - 4*k*(n + 1))/8.
T(n, 1) = T(n, n) = A002620(n).
T(n, 2) = A033638(n-1).
T(n, 3) = A290743(n-2).
Sum_{k=1..n} T(n, k) = A212964(n+1).
EXAMPLE
n\k| 1 2 3 4 5 6
---+------------
1 | 0
2 | 1 1
3 | 2 2 2
4 | 4 3 3 4
5 | 6 5 4 5 6
6 | 9 7 6 6 7 9
...
For n = 4 the matrix M(4) is
0 1 1 2
1 0 1 1
1 1 0 1
2 1 1 0
and therefore T(4, 1) = 4, T(4, 2) = 3, T(4, 3) = 3 and T(4, 4) = 4.
MATHEMATICA
T[n_, k_]:=((-1)^k+(-1)^(n-k+1)+4k^2+4n+2n^2-4k(n+1))/8; Flatten[Table[T[n, k], {n, 12}, {k, n}]] (* or *)
r[n_]:=Table[SeriesCoefficient[(2x^3y^2+y^2(1+y)+x^2(y-3y^2)-x(-1+2y+y^2))/((1-x)^3(1+x)(1-y)^3(1+y)), {x, 0, i}, {y, 0, j}], {i, n, n}, {j, n}]; Flatten[Array[r, 12]] (* or *)
r[n_]:=Table[SeriesCoefficient[1/8 E^(-x-y)(-1+E^(2 x)+2 E^(2 (x+y))(x (3+x)-2 x y+2 y^2)), {x, 0, i}, {y, 0, j}]i!j!, {i, n, n}, {j, n}]; Flatten[Array[r, 12]]
PROG
(PARI) tm(n) = {my(m = matrix(n, n, i, j, if (i==1, j\2, if (j==1, i\2)))); for (i=2, n, for (j=2, n, m[i, j] = m[i-1, j-1]; ); ); m; }
T(n, k) = my(m = tm(n)); sum(i=1, n, m[i, k]);
matrix(10, 10, n, k, if (n>=k, T(n, k), 0)) \\ Michel Marcus, Nov 12 2020
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Stefano Spezia, Nov 12 2020
STATUS
approved