# What is the optimization formulation of this question?

I found the following puzzle on SO:

Puzzle:

A merchant has a 40 kg weight which he used in his shop. Once, it fell from his hands and was broken into 4 pieces. But surprisingly, now he can weigh any weight between 1 kg to 40 kg with the combination of these 4 pieces.

So question is, what are weights of those 4 pieces?

I have recently begun reading about Optimizations so I got curious: Is there an optimization formulation for this question?

-

The more general problem is known as BACHET’S PROBLEM OF WEIGHTS. See the paper here by Edwin O'Shea or look at page $149$ of An Introduction to the Theory of Numbers by G.H. Hardy and E.M. Wright, $6$th edition. ${} {} {}$