Maximizing fire-breathing power of multi-headed dragons Dragons are gathered up on a battlefield. Certain dragons are chosen in order to provide maximum fire breathing power. A dragon can have any number of heads. The only rule is that no more than $1000$ heads can be on the battlefield. The fire breathing power is the product of the number of heads on each dragon. How many dragons, with how many heads each, should be on the battlefield in order to maximize fire breathing power?
I found this problem to be very entertaining and fun to work through. I guess and checked, and got an answer of $333$ dragons with $3$ heads each. I was not sure if this would maximize fire breathing power. I was also unsure how to show work on this problem other then guessing and checking.
 A: You can do a little better with $332$ with $3$ heads and $2$ with $2$ heads.  Note that you never want a one-head dragon.  For six heads, you are better off with $3+3$ with firepower $9$ than $2+2+2$ with firepower $8$.  As the logarithm is monotonic, you might as well maximize the log of the firepower.  In this case, a dragon with $h$ heads contributes $\log h$ to the log firepower and costs $h$ to the headcount.  You can show easily that $\frac {\log h}h$ is maximized over the naturals by $h=3$ so we want as many $3$ headed dragons as possible unless the allowable quantity is $1 \pmod 3$ in which case we improve things with $2+2$
Added: about the logarithm question.  Let's cut down to $10$ heads for simplicity.  Reasonable guesses would be $3+3+3$ with power $27$, $3+3+2+2$ with power $36$, or $2+2+2+2+2$ with power $32$.  We can see that the optimum is $3+3+2+2$ but it is hard to be sure without doing the computation because each dragon influences the product through the others.  If we take the log, the log powers become $\log 3 + \log 3 + \log 3$ and so on.  The point is that each $3$ headed dragon now brings $\log 3$ to the log power and costs $3$ heads.  The benefit/cost ratio is then $\frac {\log 3}3 \approx 0.366$  A $2$ headed dragon has a benefit/cost of $\frac {\log 2}2 \approx 0.347$ and a $4$ headed dragon has a benefit/cost of $\frac {\log 4}4 \approx 0.347$ (yes it is the same as a $2$ headed).  We would do even better with $e$ headed dragons with a benefit/cost of $\frac 1e \approx 0.368$ but fractional heads are hard to find.  So with the allowable number of heads a multiple of $3$, we should use all $3$ headed dragons, with 1 more than a multiple of $3$ use two $2$ headed dragons and the rest $3$'s, and with 2 more than a multiple of $3$ use one $2$ headed dragon and the rest $3$'s.
