Here the digital roots of the six numbers are 6, 4, 1, 2, 7, 9, which together
sum to 29, whose digital root is 2.
As the contents of the barrels sold must be
a number divisible by 3, if one buyer purchased twice as much as the other, we
must find a barrel with root 2, 5, or 8 to set on one side.
There is only one
barrel, that containing 20 gallons, that fulfils these conditions.
So the man
must have kept these 20 gallons of beer for his own use and sold one man 33
gallons (the 18-gallon and 15-gallon barrels) and sold the other man 66 gallons
(the 16, 19, and 31 gallon barrels)..