Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get a list of the combinations suchthat the elements are equal to som $n$

I want a generalization of this kind

[(r1, ..., rk) for r1 in range(n+1) ... for rk in range(n+1) if r1 + ... + rk = n]

For a general number of $r$'s and any $n$

How to get a list of the combinations suchthat the elements are equal to som $n$

I want a generalization of this kind

[(r1, ..., rk) for r1 in range(n+1) ... for rk in range(n+1) if r1 + ... + rk = n]

For a general number of $r$'s and any $n$

How to get a list of the combinations suchthat the elements are equal to som some $n$

I want a generalization of this kind

[(r1, ..., rk) for r1 in range(n+1) ... for rk in range(n+1) if r1 + ... + rk = n]

For a general number of $r$'s and any $n$