Algebraic solution to the Broken Weight Problem Here is a problem I was sent, which it turns out was first posed by Claude Gaspard Bachet de Méziriac in a book of arithmetic problems. The problem is as follows:


  A few years ago, a King's mathematics professor purchased a small farm, a place where he could unwind on the weekends and grow some fruit and vegetables. The farm came with all kinds of tools and various implements, including a large balance scale. Next to the scale was an old (pre-metric) 40 lbs stone with some initials carved into it: apparently, a previous owner had used it to weight 40 lbs of feed.
  
  One morning, while cleaning out his barn, the professor dropped the stone and it broke into four pieces.
  
  The professor was a bit sad about his carelessness, as he had liked that curious old stone. But he soon discovered something interesting: He could use the four pieces of the broken stone to weigh items on the balance scale - as long as these items were in one pound increments, between 1 and 40 pounds. 
  
  How much did each of the four pieces weigh?


Note that since this was a 17th-century merchant, he of course used the balance scale to weigh things. So, for example, he could use a 1 lb weight and a 4 lb weight to weigh a 3 lb object, by placing the 3 lb object and 1 lb weight on one side of the scale, and the 4 lb weight on the other side.

I won't post the solution as maybe some of you would like to give this a go. For anyone reading this and wanting to try it themselves, DON'T SCROLL DOWN! People will be posting their solutions there.

I did this using an intuitive method but my question I am asking is in two parts:

1) Is there an algebraic solution to this without first solving it intuitively and then finding the logic

2) Is there therefore a general form you can take to solve any problem of this type?

Good luck!
If you can weigh $1,2,3,\ldots,40$, you can also automatically weigh $-1,-2,-3,\ldots,-40$ and trivially $0$. That is, you can determine $81=3^4$ different weights by putting each of the four weights into either of the pans or not use it. This means that the condition is "sharp" - any distinct distribution of pieces results in a distinct (integer) weight as difference between the two pans. If the pieces are $a\le b\le c\le d$, then the largest possible weights are $a+b+c+d=40$ (of course) and then $b+c+d$, which must be $39$, hence $a=1$. The next smallest weight is $b+c+d-a=38$, followed by $a+c+d$, which must be $37$, hence $b=3$. Then we already know that the sequence continues with $c+d=36$, $c+d-a=35$, $c+d-b+a=34$, $c+d-b=33$, $c+d-b-a=32$. Then the next smallest (i.e., the largest not having $+c$ and $+d$) is $a+b+d$ and must equal $31$, so that $c=9$ and finally $d=27$ (as we might have guessed meanwhile).
$1,3,9,27$ are the numbers that make up to $1-40\;lb$ because....

$$\begin{align}
1&amp;=1\\
1-3&amp;=2\\
3&amp;=3\\
1+3&amp;=4\\
1+3-9&amp;=5\\
3-9&amp;=6\\
9-1&amp;=8\\
9&amp;=9\\
1+9&amp;=10\\
1-3=2+9&amp;=11\\
\end{align}$$
and so one until you get to $40$ its quite simple once you get the $4$ numbers.