A259842 Number of nonzero elements in all n X n Tesler matrices of nonnegative integers.
1, 4, 22, 178, 2114, 36398, 896128, 31136246, 1508259823, 100727634758, 9179951931947, 1131033520118692, 186769092227016256, 41008206412935719870, 11884278052476825052541, 4514826724675651497522250, 2234142899928806917974566378, 1431533853656098851281985968328
Offset: 1
Keywords
Examples
There are two 2 X 2 Tesler matrices: [1,0; 0,1], [0,1; 0,2], containing four nonzero elements, thus a(2) = 4.
Programs
-
Maple
g:= u-> `if`(u=0, 0, 1): b:= proc(n, i, l) option remember; (m->`if`(m=0, [1, g(n)], `if`(i=0, (p->p+[0, p[1]*g(n)])(b(l[1]+1, m-1, subsop(1=NULL, l))), add( (p->p+[0, p[1]*g(j)])(b(n-j, i-1, subsop(i=l[i]+j, l))) , j=0..n))))(nops(l)) end: a:= n-> b(1, n-1, [0$(n-1)])[2]: seq(a(n), n=1..14);
-
Mathematica
g[u_] := If[u == 0, 0, 1]; b[n_, i_, l_] := b[n, i, l] = Function[m, If[m == 0, {1, g[n]}, If[i == 0, # + {0, #[[1]] g[n]}&[b[l[[1]] + 1, m - 1, ReplacePart[l, 1 -> Nothing]]], Sum[# + {0, #[[1]] g[j]}&[b[n - j, i - 1, ReplacePart[ l, i -> l[[i]] + j]]], {j, 0, n}]]]][Length[l]]; a[n_] := b[1, n - 1, Table[0, {n - 1}]][[2]]; Table[Print[n, " ", a[n]]; a[n], {n, 1, 18}] (* Jean-François Alcover, May 15 2022, after Alois P. Heinz *)
Formula
a(n) = Sum_{k=1..n} A259841(n,k).
Comments