Subset of integers that sum to a given number where each integer is used once per calculation Given a set of positive integers 1-39, using each integer once per sum, how many sets of three integers sum to 65.
e.g. 1+25+39=65 counts as one set, 2+24+39=65 counts as another set.
 A: As suggested by user84413, you can count the number of triples according to the largest element.  If the largest element is 39, then the remaining two elements have to sum to 26.  We can count these remaining two elements according to which one is smaller. The smallest element can be $1, \dots, 12$ (13 is not possible since the numbers must be distinct).  Using the same technique, there are
12 triples with largest element 39,
13 triples with largest element 38, 
13 with largest element 37, 
14 with largest element 36, 
14 with largest element 35,
15 with largest element 34,
15 with largest element 33,
15 with largest element 32,
13 with largest element 31,
12 with largest element 30,
10 with largest element 29,
9 with largest element 28,
7 with largest element 27,
6 with largest element 26,
4 with largest element 25,
3 with largest element 24,
1 with largest element 23.
Note that the number of triples eventually starts decreasing since there become fewer possibilities for the smallest element.  For example, 1 cannot be the smallest element if 32 is the largest element (since the middle element would then also be 32).  
Answer. 176.
