Building a tower with a limited set of blocks A wizard has commanded you, the master architect, to build towers by stacking stone blocks.
You have at your disposal five stone masons of limited intellect.  Each mason is capable of making only a single type of cylindrical block, the height of which must be a positive integer, and the diameter of which is irrelevant.  The masons have sufficient time to build as many copies of their block type as will be needed.
The wizard, being capricious, will demand a tower with an integer height between 1 and 300 units.  There is no way to know in advance what height will be required; it will be selected from a uniform distribution.  The wizard has also decided that each tower be made of no more than five blocks.  Using multiple copies of the same block size is acceptable.  The blocks can't be stacked sideways.
What five integers do you assign to your masons to maximize the probability that you will be able to build a tower of the specified height, using no more than five blocks total?  What is that probability (i.e., the probability that you can meet the wizard's demands and escape an untimely death)?  Are there multiple solutions with equally good probability?  What is the best way to get good solutions quickly?
To restate more formally:
Select the set of five positive integers {a, b, c, d, e} which maximize the probability that
n1*a + n2*b + n3*c + n4*d + n5*e == RandomInteger[{1,300}]
n1 + n2 + n3 + n4 + n5 <= 5

has at least one solution, where n1 through n5 are integers >= 0.
The only strategy I could think of was randomly modifying an existing solution and checking if it was better than the current solution.  This is hardly efficient, and is likely to get stuck in some local maximum.  Maybe there's something more elegant.  Here's the Mathematica code:
score[{a_, b_, c_, d_, e_}] := Length[Flatten[FindInstance[{
   n1*a + n2*b + n3*c + n4*d + n5*e == #,
   n1 >= 0, n2 >= 0, n3 >= 0, n4 >= 0, n5 >= 0,
   n1 + n2 + n3 + n4 + n5 <= 5
   }, {n1, n2, n3, n4, n5}, Integers, 1] & /@ Range[300], 1]]

best = {5, 10, 15, 20, 25};
bestScore = score[best];
nRounds = 1000;

Do[
 new = best + RandomInteger[{-2, 3}, 5];
 newScore = score[new];
 If[newScore > bestScore, bestScore = newScore; best = Sort[new]];
 If[Mod[r, 10] == 0, Print[r, "  ", best, "  ", bestScore]],
 {r, 1, nRounds}
 ]

 A: I don't know how to answer this directly, but I think I can help you approach it.  We can show that the upper limit to the best solution is 251 different heights, as that is the maximum number of unique sums that can be produced.  Using Mathematica:
p = {a, b, c, d, e};
Array[Tr /@ Tuples[p, #] &, 5, 1, Union] // Length


251


You could also express this as the coefficients of the expansion of: $\left(1+x^a+x^b+x^c+x^d+x^e\right)^5$ where $(a, b, c, d, e)$ are your block heights.

After a randomized search the best values I found were:
208 : {1,5,26,60,74}
208 : {1,8,41,53,71}
209 : {1,7,48,58,73}
209 : {1,5,26,60,74}
210 : {2,7,39,57,72}  
I used this Mathematica code:
count[p_] /; Min[p] < 1 = 0;

mem : count[p_] := mem =
  -1 + Tr @ Unitize @ PadRight[
     CoefficientList[(1 + Tr["x"^p])^5, "x"], 301]

try = best = Sort @ RandomInteger[{1, 150}, 5]

Do[
  If[count[try] > count[best], Print[count[best], " : ", best = try]];
  try = Sort[best + Round @ RandomReal[NormalDistribution[0, 6], 5]],
  {100000}
]

A: Solve[a n1 + b n2 + c n3 + d n4 + e n5 == RandomInteger[{1, 300}], {a,
   b, c, d, e, n1, n2, n3, n4, n5}]

Just guessing.

