Re: [sage-combinat-devel] Partitioning N into k tuples

2012-05-15 Thread Nicolas M. Thiery
On Tue, May 15, 2012 at 08:33:23AM -0700, tvn wrote: >I am wondering if Sage has some functions to generate the below >given N,K (both are non-neg ints), return a set of tuples (n1...nk) >such that ni >= 0 and sum(ni)= N. > >So if N=5,k=2, then there are 6 tuples (5,0) (4,1)

Re: [sage-combinat-devel] Partitioning N into k tuples

2012-05-15 Thread Mike Hansen
On Tue, May 15, 2012 at 8:33 AM, tvn wrote: > I am wondering if Sage has some functions to generate the below > > given N,K  (both are non-neg ints),   return a set of tuples (n1...nk) such > that ni >= 0 and sum(ni)= N. One way to do this is the following: sage: IntegerListsLex(5, length=2).lis

[sage-combinat-devel] Partitioning N into k tuples

2012-05-15 Thread tvn
I am wondering if Sage has some functions to generate the below given N,K (both are non-neg ints), return a set of tuples (n1...nk) such that ni >= 0 and sum(ni)= N. So if N=5,k=2, then there are 6 tuples (5,0) (4,1) ... (0,5) . Is there a name for this problem ? what is the # of tu