list = {2, 1, 11, 3, 10, 7, 7, 9, 4};
n = 10;
Brutal brute force (because it's more brutal than a regular brute force)
Pick[Range@Length@list, #, 1] & /@
Tuples[{0, 1},
Length@list][[Flatten@
Position[Tuples[{0, 1}, Length@list].list, n]]]
{{5}, {4, 7}, {4, 6}, {2, 8}, {1, 2, 7}, {1, 2, 6}, {1, 2, 4, 9}}
Warning: Fails for Length@list > 24 due to lack of memory.
A more reasonable way using the same approach (and a proper answer)
Pick[Range@Length@list, #, 1] & /@
Select[FrobeniusSolve[list, n], Max@# == 1 &]
{{5}, {4, 7}, {4, 6}, {2, 8}, {1, 2, 7}, {1, 2, 6}, {1, 2, 4, 9}}
The use of IntegerPartitions seems natural:
This gives the partitions of n into elements from list:
elem = Select[IntegerPartitions[n, All, list], sublist2Q[list, #] &]
{{4, 3, 1, 2}, {9, 1}, {7, 3}, {7, 1, 2}, {7, 3}, {7, 1, 2}, {10}}
where sublist2Q is
sublist2Q[l_List, {s___}] :=
MatchQ[l, {OrderlessPatternSequence[s, ___]}]
To find the positions of elements of elem:
pos = Table[Sort@Flatten@(FirstPosition[list, #] & /@ elem[[i]]), {i, 1, Length@elem}]
{{1, 2, 4, 9}, {2, 8}, {4, 6}, {1, 2, 6}, {4, 6}, {1, 2, 6}, {5}}
This could be sorted by length:
SortBy[pos, Length]
{{5}, {2, 8}, {4, 6}, {4, 6}, {1, 2, 6}, {1, 2, 6}, {1, 2, 4, 9}}
There's an ambguity with the repeating elements, i.e. 7 in this case: {4, 6} occurs twice in pos, as well as {1, 2, 6}. I guess this would need further processing.