Why go about it backwards ?
Wouldn't it rather be better (ie. simpler) to generate a set of random numbers and pick some from the list to come up with a total ?
And btw, from your 2) wouldn't I also be able to choose 9, 5 & 4 to get my answer of 18 ? :-p
Wouldn't it rather be better (ie. simpler) to generate a set of random numbers and pick some from the list to come up with a total ?
And btw, from your 2) wouldn't I also be able to choose 9, 5 & 4 to get my answer of 18 ? :-p