That is, you need to get all possible subsets of this set.
The simplest option is to take a number of N bits for a set of N elements, and go through all possible values of the number (for 4 elements - from 0000 to 1111, that is, from 0 to 15). Next, for each number, we summarize the elements corresponding to the units of the type, for 0011 - the third and fourth (it is clear that it is more convenient and logical to count from the lower bits, so the zero and the first :))
I think it will not be a problem to translate into a specific language.
If the task is specifically in sums - then I would look at the Gray codes , then each subsequent value is obtained by adding or subtracting only one element.