How many combinations will be generated if below conditions are put? I need a generalized formula for a set having size(s) having below restrictions,

for ex. X = 2,7,11,17,26

I want only the first combination 2+7 &amp; ignore all of the combinations that start from 2+? (2-num combinations only) same for 3-num consider 2+7+11 &amp; ignore all 2+7+?



Formula should be applicable for any set X without size restriction.
$2^{n-1}-1$

Hint: 1) if you are summing with $k$ numbers $x_1,x_2,.., x_k$ note that once you choose upto $k-1$, last selection is forced on you as the next ascending number to $x_{k-1}$.
2) You are allowed to choose first $k-1$ numbers from n-1 numbers