%I #9 May 17 2022 03:40:51
%S 1,1,3,22,351,11275,689146,76718466,15016410213,5018597151979,
%T 2793390337774000,2534303740130716491,3677548139455638020060,
%U 8393668597786379602398164,29683833854927200499142474520,160463839044675821511377573062150,1309702228155431081923017737636343876
%N Number of n X n upper triangular matrices (m_{i,j}) of nonnegative integers with 2 = Sum_{j=h..n} m_{h,j} - Sum_{i=1..h-1} m_{i,h} for all h in {1,...,n}.
%C a(n) counts generalized Tesler matrices. For the definition of Tesler matrices see A008608.
%e a(2) = 3: [1,1; 0,3], [2,0; 0,2], [0,2; 0,4].
%p b:= proc(n, i, l) option remember; (m-> `if`(m=0, 1,
%p `if`(i=0, b(l[1]+2, m-1, subsop(1=NULL, l)), add(
%p b(n-j, i-1, subsop(i=l[i]+j, l)), j=0..n))))(nops(l))
%p end:
%p a:= n-> b(2, n-1, [0$(n-1)]):
%p seq(a(n), n=0..10);
%t b[n_, i_, l_] := b[n, i, l] = With[{m = Length[l]}, If[m == 0, 1,
%t If[i == 0, b[l[[1]] + 2, m - 1, ReplacePart[l, 1 -> Nothing]], Sum[
%t b[n - j, i - 1, ReplacePart[l, i -> l[[i]] + j]], {j, 0, n}]]]];
%t a[n_] := If[n <= 1, 1, b[2, n - 1, Array[0&, n - 1]]];
%t Table[Print[n, " ", a[n]]; a[n], {n, 0, 14}] (* _Jean-François Alcover_, May 17 2022, after _Alois P. Heinz_ *)
%Y Column k=2 of A259844.
%Y Cf. A008608.
%K nonn
%O 0,3
%A _Alois P. Heinz_, Jul 08 2015