OFFSET
0,13
COMMENTS
The number of partitions of m into up to n positive integers each no more than k is maximized for given n and k by m=floor(nk/2) or ceiling(nk/2) (and possibly some other values).
EXAMPLE
Rows start:
1, 1, 1, 1, 1, 1, ...;
1, 1, 1, 1, 1, 1, ...;
1, 1, 2, 2, 3, 3, ...;
1, 1, 2, 3, 5, 6, ...;
1, 1, 3, 5, 8, 12, ...; etc.
T(4,5)=12 since 10 can be partitioned into
5+5, 5+4+1, 5+3+2, 5+3+1+1, 5+2+2+1, 4+4+2, 4+3+3,
4+4+1+1, 4+3+2+1, 4+2+2+2, 3+3+3+1, and 3+3+2+2.
MAPLE
A067059 := proc(n, k)
local m, a1, a2 ;
a1 := 0 ;
m := floor(n*k/2) ;
for L in combinat[partition](m) do
if nops(L) <= n then
if max(op(L)) <= k then
a1 := a1+1 ;
end if ;
end if;
end do:
a2 := 0 ;
m := ceil(n*k/2) ;
for L in combinat[partition](m) do
if nops(L) <= n then
if max(op(L)) <= k then
a2 := a2+1 ;
end if ;
end if;
end do:
max(a1, a2) ;
end proc:
for d from 0 to 12 do
for k from 0 to d do
printf("%d, ", A067059(d-k, k)) ;
end do:
end do: # R. J. Mathar, Nov 13 2016
MATHEMATICA
t[n_, k_] := Length[ IntegerPartitions[ Floor[n*k/2], n, Range[k]]]; Flatten[ Table[ t[n-k , k], {n, 0, 13}, {k, 0, n}]] (* Jean-François Alcover, Jan 02 2012 *)
PROG
(Sage)
def A067059(n, k):
return Partitions((n*k)//2, max_length=n, max_part=k).cardinality()
for n in (0..9): [A067059(n, k) for k in (0..9)] # Peter Luschny, May 05 2014
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Henry Bottomley, Feb 17 2002
STATUS
approved