382. What is the smallest number of weights and of what weight can be used to weigh any whole number of pounds from 1 to 40 on a balance scale, given that during weighing, weights can be placed on both pans of the scale.
382. The solution to the problem is based on the properties of the ternary system of numeration, which can express any numbers; since the number $40=27+9+3+1=3^{3}+3^{2}+3+1$, it is possible with four weights of $27, 9, 3$ and 1 pound, as is easy to verify by checking, to weigh any load up to forty pounds. It is sufficient to take any load and express it in the ternary system: for example,

$$
23=27-(3+1) ; 31=27+3+1
$$

and so on.