[seqfan] Re: n-multisets of integers in (-n..n} adding to n
Maximilian Hasler
maximilian.hasler at gmail.com
Thu Apr 12 18:06:12 CEST 2012
On Thu, Apr 12, 2012 at 4:03 AM, David Scambler wrote:
> Count all n-multisets of integers in {-n, ..., n} such that the members sum to n.
This is the same than n-multisets of integers in [0..2n] such that the
members sum to n(n+1).
So it might be interesting to have the more general function
f( n,m,k ) = # of n-multisets in [0..m] whose elements sum up to k.
This cannot obviously be coded as one simple table
(although for given n and m it will be zero for large enough k (> n*m)
which nevertheless would allow to pack all in one table or sequence)
One could make one table f(n,m,k) for each n > 2
or alternatively / additionnally only consider m = a*n
and make a table for
a=1 <=> m=n (already there ?)
a=2 <=> m=2n (yours, the above)
a=3 <=> m=3n, etc.
Regards,
Maximilian
More information about the SeqFan
mailing list