1 | initial version |
Use something like that
sage: [v for v in IntegerVectors(n=4,k=3)]
[[4, 0, 0],
[3, 1, 0],
[3, 0, 1],
[2, 2, 0],
[2, 1, 1],
[2, 0, 2],
[1, 3, 0],
[1, 2, 1],
[1, 1, 2],
[1, 0, 3],
[0, 4, 0],
[0, 3, 1],
[0, 2, 2],
[0, 1, 3],
[0, 0, 4]]