%I #18 Aug 21 2023 08:23:50
%S 1,1,1,1,2,2,1,2,3,2,1,3,6,7,3,1,3,9,14,12,4,1,4,12,28,34,21,5,1,4,17,
%T 46,78,74,35,6,1,5,22,74,156,207,154,58,8,1,5,27,107,282,476,504,304,
%U 91,10,1,6,34,154,471,985,1349,1169,580,142,12,1,6,41,208,744,1842,3142,3571,2574,1066,215,15
%N T(n,k) is the number of strings of numbers x(i=1..n) in 0..k with sum i*x(i) equal to k*n.
%C T(n,k) is the number of integer lattice points in k*P_n, where P_n is the polytope in R^n defined by the constraints 0 <= x_i <= 1 and Sum_{i=1..n} i x_i = n. Thus for each n, T(n,k) is an Ehrhart quasi-polynomial. - _Robert Israel_, Dec 21 2022
%H R. H. Hardin, <a href="/A184703/b184703.txt">Table of n, a(n) for n = 1..2113</a>
%e Table starts:
%e 1 1 1 1 1 1 1 1 1 1 1 1
%e 1 2 2 3 3 4 4 5 5 6 6 7
%e 2 3 6 9 12 17 22 27 34 41 48 57
%e 2 7 14 28 46 74 107 154 208 278 357 456
%e 3 12 34 78 156 282 471 744 1119 1623 2279 3118
%e 4 21 74 207 476 985 1842 3226 5325 8414 12766 18789
%e 5 35 154 504 1349 3142 6575 12688 22923 39266 64315 101460
%e 6 58 304 1169 3571 9353 21713 46037 90595 167917 295811 499442
%e 8 91 580 2574 8939 26146 67105 155645 332729 665317 1257898 2268061
%e 10 142 1066 5439 21310 69331 195760 495251 1146377 2467215 4994696 9599863
%e Some solutions for n=5, k=4:
%e 4 4 2 0 1 2 1 0 2 4 0 0 4 0 2 2
%e 1 2 3 1 2 0 2 0 1 1 0 0 0 2 2 1
%e 2 1 4 0 1 2 2 1 4 0 4 0 4 0 2 2
%e 2 1 0 2 3 3 1 3 1 1 2 0 1 4 2 0
%e 0 1 0 2 0 0 1 1 0 2 0 4 0 0 0 2
%p S:= proc(n,k,s) option remember; local j;
%p if n = 1 then
%p if s <= k then return 1 else return 0 fi
%p fi;
%p add(procname(n-1,k,s-j*n), j=0..min(s/n,k))
%p end proc:
%p [seq(seq(S(n,m-n,(m-n)*n),n=1..m-1),m=1..20)]; # _Robert Israel_, Dec 21 2022
%t S[n_, k_, s_] := S[n, k, s] = Module[{}, If[n == 1, If[s <= k, Return@1, Return@0]]; Sum[S[n - 1, k, s - j*n], {j, 0, Min[s/n, k]}]];
%t Table[Table[S[n, m - n, (m - n)*n], {n, 1, m - 1}], {m, 1, 20}] // Flatten (* _Jean-François Alcover_, Aug 21 2023, after _Robert Israel_ *)
%Y Column 1 is A000009.
%Y Row 3 is A008810(n+1).
%K nonn,tabl
%O 1,5
%A _R. H. Hardin_, Jan 20 2011
|