A259787 Total element sum of all n X n Tesler matrices of nonnegative integers.
1, 5, 31, 270, 3370, 60146, 1522031, 54055976, 2666453502, 180847717069, 16704822358932, 2082808024263350, 347639192485104658, 77076883307827211845, 22537752778732740525833, 8633258320969387044105210, 4305220991520242104331411368, 2778601200692503839128415662124
Offset: 1
Keywords
Examples
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.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..21
Programs
-
Maple
b:= proc(n, i, l) option remember; (m-> `if`(m=0, [1, 0], `if`(i=0, (p-> p+[0, p[1]*(l[1]+1)])(b(l[1]+1, m-1, subsop(1=NULL, l))), add(b(n-j, i-1, subsop(i=l[i]+j, l)), j=0..n))))(nops(l)) end: a:= n-> (p-> p[1]+p[2])(b(1, n-1, [0$(n-1)])): seq(a(n), n=1..14);
-
Mathematica
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]]; a[n_] := Function[p, p[[1]] + p[[2]]][b[1, n - 1, Table[0, {n - 1}]]]; Table[a[n], {n, 1, 14}] (* Jean-François Alcover, Jun 27 2022, after Alois P. Heinz *)
Comments