Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 6 years ago

MarioM gravatar image

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