In my scribbles, the puzzle came down to the following question: What are four numbers in which the addition or subtraction of one, two, three, or four of these numbers equals 1, 2, 3, ... 40?
Rough Work
I started by selecting masses of 1, 2, 3, and 4 grams. Under the question, this permitted the scale to balance all masses 1, 2, 3, ... 10 grams. With masses of 2, 3, 4, and 5 grams, I could balance all masses from 1 to 14 grams. However, with masses of 3, 4, 5, 6, I could not reach masses of 12, 14, 16, or 17 grams.
I then tried 1, 3, 5, 7 and this worked for all masses 1 to 16 grams. However, when I tried 3, 5, 7, and 11 I could not get 21 grams. I noticed there were redundant combinations to produce certain masses, such as 2 for instance. I went back in my development to state that I needed 1 or a difference of 1. This rule holds true for all numbers up to 40. I then approached the problem with using prime numbers. 1, 3, 7, 13 work to balance masses of 1 to 24 grams. However, when I kept increasing the fourth mass, I reached the set of 1, 3, 11, and 19 where I couldn't balance 24 grams.
After a few days, I returned to my sheet of scribbles to realize that I could follow an more general approach.
A Solution
Consider a, b, c, d whole numbers.
For a = 1, b = 2, we have the ability to balance 1, 2, and 3 grams. Therefore, for any c, we can balance masses that equal c as well as plus or minus 1, 2, or 3 grams.
For a = 1, b = 3, we can balance 1, 2, 3, and 4 grams. For a continuous balance (with maximum combinations for a, b, c) we must have c such that 4 grams less than c is 4 + 1. Therefore, consider c = 9. With 1, 3, and 9 we can balance masses of 1 to 13 grams. Under the same idea, in choosing d, we let d = 27. Therefore, we may balance masses of 1 to 40 grams. Thus, a solution for the four masses is 1, 3, 9, and 27 grams.
Are there other solutions? I don't think so with only four masses. However, I will have to think about it and I look forward to seeing what my classmates have done.