Tricky combinatorial number theory $100$ blocks are selected from a crate containing 33 blocks of each of the following dimensions: $13 \times 17 \times 21$, $13 \times 17 \times 37$, $13 \times 21 \times 37$, and $17 \times 21 \times 37$. The chosen blocks are stacked on top of each other (one per cross section) forming a tower of height $h$. Compute the number of possible values of $h$.
I haven't got very far with this problem. All I know is that $h$ is of the form $13a+17b+21c+37d$ and the problem comes down to finding restrictions on $a,b,c,d$. I am trying to think how to exploit the symmetry in the problem. Also I am unsure of how to deal with "repeats" - $13a+17b+21c+37d$ may assume the same value for different ordered   quadruples $(a,b,c,d)$.
 A: Some thoughts: 
The differences between your four dimensions are all multiples of four. So given any arrangement of 100 blocks, you can adjust any one block and change the height of the entire collection buy multiples of four.
So your stack of minimum height is given by $13\cdot 99+17= 1304$ and your maximum height is $37\cdot 99+21=3684$ and most of the multiples of 4 are attainable. The problem is when your stack contains mostly 21's and 37's. Some of the multiples of four towards the high end of the range are not obtainable.
Update: The more I think about it, every multiple of 4 should be obtainable. I'm driving right now so I can't put pencil to paper yet, but hopefully this will get you going.
Update: What do you know about generating functions?
A: I found a generating function that will work! We need two variables; the variable $u$ will count the inclusion of a block in our stack and the variable $z$ will track which dimension of the block we include in our stack. Thus
$$
(1+uz^{13}+uz^{17}+uz^{21})^{33}(1+uz^{13}+uz^{17}+uz^{37})^{33}(1+uz^{13}+uz^{21}+uz^{37})^{33}(1+uz^{17}+uz^{21}+uz^{37})^{33}
$$
is the generating function we want. In particular, the coefficient of $u^{100}$ will be a polynomial in $z$ whose exponents will be all the possible heights.
Computationally, this is a beast. Maple (implemented on my laptop) gave up on it.
