Each new number obviously had to be greater than any previous, because otherwise sums are not unique, but also the sums it made when paired with any previous number had to be distinct from all previous pairs (otherwise when this pair is combined with a third number you can't distinguish it from the other pair)--except for the last box, where we can ignore this point.

While the solution is correct, the logic quoted above in attaining it is not. By that logic the 6th bag (13) could be 10 instead as no two numbers before it add up to 10. However, 10+1 = 7+4. Therefore, you also have to check to be sure that the number plus any previous number does not sum to the same as any two previous numbers. That will get you a little farther (to 13 appropriately). But even with that additional caveat you'll find problems. 21 would be the next available number using those rules, but 0+1+21 = 2+7+13. So you'd also have to add the restriction that the new number plus any 2 previous numbers can't sum to the sum of any three previous numbers, which is just stating the problem of unique triples over again.

So... here's the logic you have to use to solve it: Start with 0, 1, 2, 4 and thereafter the next number in the series = the sum of the last three numbers. The sum of the last three numbers in the series is the highest possible sum to that point, and the new number must at a minimum add 0 and 1, thereby guaranteeing unique triples.