%I #20 Jun 27 2022 07:50:42
%S 1,5,31,270,3370,60146,1522031,54055976,2666453502,180847717069,
%T 16704822358932,2082808024263350,347639192485104658,
%U 77076883307827211845,22537752778732740525833,8633258320969387044105210,4305220991520242104331411368,2778601200692503839128415662124
%N Total element sum of all n X n Tesler matrices of nonnegative integers.
%C For the definition of Tesler matrices see A008608.
%H Alois P. Heinz, <a href="/A259787/b259787.txt">Table of n, a(n) for n = 1..21</a>
%F a(n) = Sum_{k=0..n*(n-1)/2} (n+k) * A259786(n,k).
%F a(n) = Sum_{k=0..n} k * A259841(n,k).
%e There are two 2 X 2 Tesler matrices: [1,0; 0,1], [0,1; 0,2], the total sum of all elements gives a(2) = 5.
%p b:= proc(n, i, l) option remember; (m-> `if`(m=0, [1, 0], `if`(i=0,
%p (p-> p+[0, p[1]*(l[1]+1)])(b(l[1]+1, m-1, subsop(1=NULL, l))),
%p add(b(n-j, i-1, subsop(i=l[i]+j, l)), j=0..n))))(nops(l))
%p end:
%p a:= n-> (p-> p[1]+p[2])(b(1, n-1, [0$(n-1)])):
%p seq(a(n), n=1..14);
%t b[n_, i_, l_] := b[n, i, l] = Function[m, If[m == 0, {1, 0}, If[i == 0, Function[p, p + {0, p[[1]]*(l[[1]] + 1)}][b[l[[1]] + 1, m - 1, ReplacePart[l, 1 -> Nothing]]], Sum[b[n - j, i - 1, ReplacePart[l, i -> l[[i]] + j]], {j, 0, n}]]]][Length[l]];
%t a[n_] := Function[p, p[[1]] + p[[2]]][b[1, n - 1, Table[0, {n - 1}]]];
%t Table[a[n], {n, 1, 14}] (* _Jean-François Alcover_, Jun 27 2022, after _Alois P. Heinz_ *)
%Y Cf. A008608, A259786, A259841.
%K nonn
%O 1,2
%A _Alois P. Heinz_, Jul 05 2015