Counting groups with combined scores of 10 Suppose that a math class has $24$ students, and the scores on a recent test are $\{1=\text{poor}, 2=\text{basic}, 3=\text{proficient}, 4=\text{excellent}\}$. The number of students in each score category is the same.  If the students line up for class the next day, how many lines are there such that the teacher can split up the line of students in groups (not necessarily the same size) with a combined score of $10$ without rearranging the line?

Basically, we want to count the number of permutations of $a=(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4)$ such that there are partial sums $\sum_{i=0}^{n} a_i$ of values $10,20,30,40,50$ and $60$. Since the total combined score of the students is $60$, it is automatically a partial sum
For example, $a$ is already a valid line because we have partial sums of $(1,3,6,10,11,13,16,20,...60)$ and $10,20,30,40,50,60$ occur in this sequence.
Another harder-to-detect example would be $(1, 2, 2, 3, 2, 4, 1, 1, 2, 2, 4, 4, 2, 4, 4, 1, 1, 3, 3, 4, 3, 3, 3, 1)$ since we can split the line as $( [1, 2, 2, 3, 2], [4, 1, 1, 2, 2], [4, 4, 2], [4, 4, 1, 1], [3, 3, 4], [3, 3, 3, 1] )$.
If we had something like $(4,4,4,4,4,4,3,3,3,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1)$, then it would not be a valid line because the partial sums are $(4,8,12,16,20,24,....60)$ but $10$ does not occur as a partial sum for this sequence.
 A: First determine all integer solutions to $x_1+2x_2+3x_3+4x_4=10$ where $0\le x_i\le6$, corresponding to partitions of $10$ into parts of size $1,2,3,4$ with at most $6$ of each part. Any admissible permutation of the student scores splits into six parts, each with sum $10$ and being an ordering of some partition of the kind previously described. To each solution $(x_i)$ associate the monomial
$$\binom{x_1+x_2+x_3+x_4}{x_1,x_2,x_3,x_4}t^{x_1}u^{x_2}v^{x_3}w^{x_4}$$
and add the monomials up. The resulting polynomial $A$ is the generating function for the ordered partitions of $10$ into parts of size $1,2,3,4$ with at most $6$ of each part.
The desired number is then simply the $(tuvw)^6$ coefficient of $A^6$, which is $20448394596$. The following Mathematica code computes this:
xx = Table[x[i], {i,4}]
Z = Solve[{x[1]+2x[2]+3x[3]+4x[4] == 10}~Join~Table[0<=v<=6, {v,xx}], xx, NonNegativeIntegers]
sols = xx /. Z
tens = Total[(Multinomial@@# * Times@@(xx^#) &) /@ sols]
Fold[FullSimplify[SeriesCoefficient[#1, {#2,0,6}]]&, tens^6, xx]

