OFFSET
2,3
LINKS
Robert P. P. McKone, Antidiagonals n = 2..100, flattened
FORMULA
EXAMPLE
For n = 3 and k = 4, there are 21 strings: {0000, 0001, 0002, 0010, 0011, 0012, 0020, 0021, 0022, 0100, 0200, 1000, 1001, 1002, 1100, 1200, 2000, 2001, 2002, 2100, 2200}.
Square table T(n,k):
k=2: k=3: k=4: k=5: k=6: k=7:
n=2: 1 3 8 19 43 94
n=3: 1 5 21 79 281 963
n=4: 1 7 40 205 991 4612
n=5: 1 9 65 421 2569 15085
n=6: 1 11 96 751 5531 39186
n=7: 1 13 133 1219 10513 87199
n=8: 1 15 176 1849 18271 173608
n=9: 1 17 225 2665 29681 317817
MATHEMATICA
m[r_] := Normal[With[{p = 1/n}, SparseArray[{Band[{1, 2}] -> p, {i_, 1} /; i <= r -> 1 - p, {r + 1, r + 1} -> 1}]]];
T[n_, k_, r_] := MatrixPower[m[r], k][[1, r + 1]]*n^k;
Reverse[Table[T[n, k - n + 2, 2], {k, 2, 11}, {n, 2, k}], 2] // Flatten (* Robert P. P. McKone, Jan 26 2021 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Robert P. P. McKone, Dec 29 2020
STATUS
approved