List all k-tuples with entries summing to n, ignoring rotations
问题 Is there an efficient algorithm for finding all sequences of k non-negative integers that sum to n , while avoiding rotations (completely, if possible)? The order matters, but rotations are redundant for the problem I'm working on. For example, with k = 3 and n = 3, I would want to get a list like the following: (3, 0, 0), (2, 1, 0), (2, 0, 1), (1, 1, 1). The tuple (0, 3, 0) should not be on the list, since it is a rotation of (3, 0, 0). However, (0, 3, 0) could be in the list instead of (3,