Given a set of positive integers \$ S \$, output the set of all positive integers \$ n \$ such that \$ n \$ can be made by summing a subset of \$ S \$ in more than one different way, i.e., that are the sums of more than one subset of \$ S \$.
To be clear, a subset of \$ S \$ means that you can't use numbers from \$ S \$ more than once.
Example
For example, given \$ S = \{2, 3, 5, 6\} \$, the following numbers can be made:
- \$ 2 = \sum\{2\} \$
- \$ 3 = \sum\{3\} \$
- \$ 5 = \sum\{5\} = \sum\{2, 3\} \$
- \$ 6 = \sum\{6\} \$
- \$ 7 = \sum\{2, 5\} \$
- \$ 8 = \sum\{2, 6\} = \sum\{3, 5\} \$
- \$ 9 = \sum\{3, 6\} \$
- \$ 10 = \sum\{2, 3, 5\} \$
- \$ 11 = \sum\{5, 6\} = \sum\{2, 3, 6\} \$
- \$ 13 = \sum\{2, 5, 6\} \$
- \$ 14 = \sum\{3, 5, 6\} \$
- \$ 16 = \sum\{2, 3, 5, 6\} \$
Of these, only \$ 5 \$, \$ 8 \$, and \$ 11 \$ can be made in more than one way. Therefore, [5, 8, 11]
is the output.
Rules
- The input will be non-empty and contain no duplicate numbers
- Output may be in any order, but it must not contain duplicate numbers
- You may use any standard I/O method
- Standard loopholes are forbidden
- This is code-golf, so the shortest code in bytes wins
Test cases
[1] -> []
[4, 5, 2] -> []
[9, 10, 11, 12] -> [21]
[2, 3, 5, 6] -> [5, 8, 11]
[15, 16, 7, 1, 4] -> [16, 20, 23, 27]
[1, 2, 3, 4, 5] -> [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]