This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A340156 #73 Feb 03 2021 23:01:36 %S A340156 1,1,3,1,5,8,1,7,21,19,1,9,40,79,43,1,11,65,205,281,94,1,13,96,421, %T A340156 991,963,201,1,15,133,751,2569,4612,3217,423,1,17,176,1219,5531,15085, %U A340156 20905,10547,880,1,19,225,1849,10513,39186,86241,92935,34089,1815 %N A340156 Square array read by upward antidiagonals: T(n, k) is the number of n-ary strings of length k containing 00. %H A340156 Robert P. P. McKone, <a href="/A340156/b340156.txt">Antidiagonals n = 2..100, flattened</a> %F A340156 T(n, k) = n^k - A180165(n+1,k-1), where A180165 in the number of strings not containing 00. %F A340156 m(2) = [1 - 1/n, 1/n, 0; 1 - 1/n, 0, 1/n; 0, 0, 1], is the probability/transition matrix for two consecutive "0" -> "containing 00". %e A340156 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}. %e A340156 Square table T(n,k): %e A340156 k=2: k=3: k=4: k=5: k=6: k=7: %e A340156 n=2: 1 3 8 19 43 94 %e A340156 n=3: 1 5 21 79 281 963 %e A340156 n=4: 1 7 40 205 991 4612 %e A340156 n=5: 1 9 65 421 2569 15085 %e A340156 n=6: 1 11 96 751 5531 39186 %e A340156 n=7: 1 13 133 1219 10513 87199 %e A340156 n=8: 1 15 176 1849 18271 173608 %e A340156 n=9: 1 17 225 2665 29681 317817 %t A340156 m[r_] := Normal[With[{p = 1/n}, SparseArray[{Band[{1, 2}] -> p, {i_, 1} /; i <= r -> 1 - p, {r + 1, r + 1} -> 1}]]]; %t A340156 T[n_, k_, r_] := MatrixPower[m[r], k][[1, r + 1]]*n^k; %t A340156 Reverse[Table[T[n, k - n + 2, 2], {k, 2, 11}, {n, 2, k}], 2] // Flatten (* _Robert P. P. McKone_, Jan 26 2021 *) %Y A340156 Cf. A008466 (row 2), A186244 (row 3), A000567 (column 4). %Y A340156 Cf. A180165 (not containing 00), A340242 (containing 000). %Y A340156 Cf. A000045, A028859, A125145, A086347, A180033, A180167, A322054. %Y A340156 Cf. A005563, A033445. %K A340156 nonn,tabl %O A340156 2,3 %A A340156 _Robert P. P. McKone_, Dec 29 2020